<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-comment">-- | Typechecking pattern synonym declarations</span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.TyCl.PatSyn</span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynDecl"><span class="hs-identifier">tcPatSynDecl</span></a></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderBind"><span class="hs-identifier">tcPatSynBuilderBind</span></a></span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderOcc"><span class="hs-identifier">tcPatSynBuilderOcc</span></a></span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#nonBidirectionalErr"><span class="hs-identifier">nonBidirectionalErr</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span class="hs-keyword">where</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Pat.html"><span class="hs-identifier">GHC.Tc.Gen.Pat</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier">tidyTyCoVarBinders</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier">tidyTypes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier">tidyType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html"><span class="hs-identifier">GHC.Tc.Gen.Sig</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier">emptyPragEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier">completeSigFromId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html"><span class="hs-identifier">GHC.Core.PatSyn</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#emptyTidyEnv"><span class="hs-identifier">emptyTidyEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#mkInScopeSet"><span class="hs-identifier">mkInScopeSet</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#RecSelParent"><span class="hs-identifier">RecSelParent</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html#setLevityInfoWithType"><span class="hs-identifier">setLevityInfoWithType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Bind.html"><span class="hs-identifier">GHC.Tc.Gen.Bind</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Solver.html"><span class="hs-identifier">GHC.Tc.Solver</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html"><span class="hs-identifier">GHC.Core.Predicate</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Build.html"><span class="hs-identifier">GHC.Tc.TyCl.Build</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html"><span class="hs-identifier">GHC.Types.Id.Make</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.TyCl.Utils.html"><span class="hs-identifier">GHC.Tc.TyCl.Utils</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html"><span class="hs-identifier">GHC.Core.ConLike</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.FieldLabel.html"><span class="hs-identifier">GHC.Types.FieldLabel</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier">getDynFlags</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier">mapMaybe</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier">zipWithM</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-71"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                    Type checking a pattern synonym
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynDecl"><span class="hs-identifier hs-type">tcPatSynDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-80"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcSigInfo"><span class="hs-identifier hs-type">TcSigInfo</span></a></span><span>
</span><span id="line-81"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span id="tcPatSynDecl"><span class="annot"><span class="annottext">tcPatSynDecl :: PatSynBind GhcRn GhcRn
-&gt; Maybe TcSigInfo -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynDecl"><span class="hs-identifier hs-var hs-var">tcPatSynDecl</span></a></span></span><span> </span><span id="local-6989586621681095892"><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095892"><span class="hs-identifier hs-var">psb</span></a></span></span><span> </span><span id="local-6989586621681095891"><span class="annot"><span class="annottext">Maybe TcSigInfo
</span><a href="#local-6989586621681095891"><span class="hs-identifier hs-var">mb_sig</span></a></span></span><span>
</span><span id="line-83"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (LHsBinds GhcTc, TcGblEnv)
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall r. TcRn r -&gt; TcRn r -&gt; TcRn r
</span><a href="GHC.Tc.Utils.Monad.html#recoverM"><span class="hs-identifier hs-var">recoverM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#recoverPSB"><span class="hs-identifier hs-var">recoverPSB</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095892"><span class="hs-identifier hs-var">psb</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv))
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe TcSigInfo
</span><a href="#local-6989586621681095891"><span class="hs-identifier hs-var">mb_sig</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-85"></span><span>      </span><span class="annot"><span class="annottext">Maybe TcSigInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcInferPatSynDecl"><span class="hs-identifier hs-var">tcInferPatSynDecl</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095892"><span class="hs-identifier hs-var">psb</span></a></span><span>
</span><span id="line-86"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#TcPatSynSig"><span class="hs-identifier hs-type">TcPatSynSig</span></a></span><span> </span><span id="local-6989586621681095886"><span class="annot"><span class="annottext">TcPatSynInfo
</span><a href="#local-6989586621681095886"><span class="hs-identifier hs-var">tpsi</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
-&gt; TcPatSynInfo -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcCheckPatSynDecl"><span class="hs-identifier hs-var">tcCheckPatSynDecl</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095892"><span class="hs-identifier hs-var">psb</span></a></span><span> </span><span class="annot"><span class="annottext">TcPatSynInfo
</span><a href="#local-6989586621681095886"><span class="hs-identifier hs-var">tpsi</span></a></span><span>
</span><span id="line-87"></span><span>      </span><span class="annot"><span class="annottext">Maybe TcSigInfo
</span><span class="hs-identifier">_</span></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynDecl&quot;</span></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#recoverPSB"><span class="hs-identifier hs-type">recoverPSB</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-90"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- See Note [Pattern synonym error recovery]</span><span>
</span><span id="line-92"></span><span id="recoverPSB"><span class="annot"><span class="annottext">recoverPSB :: PatSynBind GhcRn GhcRn -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#recoverPSB"><span class="hs-identifier hs-var hs-var">recoverPSB</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095880"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681095880"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-93"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_args :: forall idL idR.
PatSynBind idL idR -&gt; HsPatSynDetails (Located (IdP idR))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095878"><span class="annot"><span class="annottext">HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095878"><span class="hs-identifier hs-var">details</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095877"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095877"><span class="hs-identifier hs-var">matcher_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf TcGblEnv TcLclEnv Name
forall m n. Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf m n Name
</span><a href="GHC.Tc.TyCl.Build.html#newImplicitBinder"><span class="hs-identifier hs-var">newImplicitBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095880"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkMatcherOcc"><span class="hs-identifier hs-var">mkMatcherOcc</span></a></span><span>
</span><span id="line-95"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095874"><span class="annot"><span class="annottext">placeholder :: TyThing
</span><a href="#local-6989586621681095874"><span class="hs-identifier hs-var hs-var">placeholder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; TyThing
</span><a href="GHC.Core.TyCo.Rep.html#AConLike"><span class="hs-identifier hs-var">AConLike</span></a></span><span> </span><span class="annot"><span class="annottext">(ConLike -&gt; TyThing) -&gt; ConLike -&gt; TyThing
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-var">PatSynCon</span></a></span><span> </span><span class="annot"><span class="annottext">(PatSyn -&gt; ConLike) -&gt; PatSyn -&gt; ConLike
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-96"></span><span>                          </span><span class="annot"><span class="annottext">Name -&gt; PatSyn
</span><a href="#local-6989586621681095871"><span class="hs-identifier hs-var">mk_placeholder</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095877"><span class="hs-identifier hs-var">matcher_name</span></a></span><span>
</span><span id="line-97"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095870"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681095870"><span class="hs-identifier hs-var">gbl_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyThing] -&gt; TcM TcGblEnv -&gt; TcM TcGblEnv
forall r. [TyThing] -&gt; TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Env.html#tcExtendGlobalEnv"><span class="hs-identifier hs-var">tcExtendGlobalEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681095874"><span class="hs-identifier hs-var">placeholder</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">TcM TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-98"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681095870"><span class="hs-identifier hs-var">gbl_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-100"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681095866"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095866"><span class="hs-identifier hs-var">_arg_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095865"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095865"><span class="hs-identifier hs-var">_rec_fields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095864"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095864"><span class="hs-identifier hs-var">is_infix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name) -&gt; ([Name], [Name], Bool)
</span><a href="GHC.Tc.TyCl.PatSyn.html#collectPatSynArgInfo"><span class="hs-identifier hs-var">collectPatSynArgInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name)
HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095878"><span class="hs-identifier hs-var">details</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621681095871"><span class="annot"><span class="annottext">mk_placeholder :: Name -&gt; PatSyn
</span><a href="#local-6989586621681095871"><span class="hs-identifier hs-var hs-var">mk_placeholder</span></a></span></span><span> </span><span id="local-6989586621681095862"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095862"><span class="hs-identifier hs-var">matcher_name</span></a></span></span><span>
</span><span id="line-102"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; Bool
-&gt; ([VarBndr Id Specificity], [Kind])
-&gt; ([VarBndr Id Specificity], [Kind])
-&gt; [Kind]
-&gt; Kind
-&gt; (Id, Bool)
-&gt; Maybe (Id, Bool)
-&gt; [FieldLabel]
-&gt; PatSyn
</span><a href="GHC.Core.PatSyn.html#mkPatSyn"><span class="hs-identifier hs-var">mkPatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095880"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095864"><span class="hs-identifier hs-var">is_infix</span></a></span><span>
</span><span id="line-103"></span><span>                        </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">Specificity -&gt; Id -&gt; VarBndr Id Specificity
forall vis. vis -&gt; Id -&gt; VarBndr Id vis
</span><a href="GHC.Types.Var.html#mkTyVarBinder"><span class="hs-identifier hs-var">mkTyVarBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#SpecifiedSpec"><span class="hs-identifier hs-var">SpecifiedSpec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span>                        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Arg tys</span><span>
</span><span id="line-105"></span><span>                        </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span>
</span><span id="line-106"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095856"><span class="hs-identifier hs-var">matcher_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-107"></span><span>                        </span><span class="hs-special">[</span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- Field labels</span><span>
</span><span id="line-108"></span><span>       </span><span class="hs-keyword">where</span><span>
</span><span id="line-109"></span><span>         </span><span class="hs-comment">-- The matcher_id is used only by the desugarer, so actually</span><span>
</span><span id="line-110"></span><span>         </span><span class="hs-comment">-- and error-thunk would probably do just as well here.</span><span>
</span><span id="line-111"></span><span>         </span><span id="local-6989586621681095856"><span class="annot"><span class="annottext">matcher_id :: Id
</span><a href="#local-6989586621681095856"><span class="hs-identifier hs-var hs-var">matcher_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Kind -&gt; Kind -&gt; Id
Name -&gt; Kind -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095862"><span class="hs-identifier hs-var">matcher_name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Id) -&gt; Kind -&gt; Id
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-112"></span><span>                      </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">{- Note [Pattern synonym error recovery]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If type inference for a pattern synonym fails, we can't continue with
the rest of tc_patsyn_finish, because we may get knock-on errors, or
even a crash.  E.g. from
   pattern What = True :: Maybe
we get a kind error; and we must stop right away (#15289).

We stop if there are /any/ unsolved constraints, not just insoluble
ones; because pattern synonyms are top-level things, we will never
solve them later if we can't solve them now.  And if we were to carry
on, tc_patsyn_finish does zonkTcTypeToType, which defaults any
unsolved unificatdion variables to Any, which confuses the error
reporting no end (#15685).

So we use simplifyTop to completely solve the constraint, report
any errors, throw an exception.

Even in the event of such an error we can recover and carry on, just
as we do for value bindings, provided we plug in placeholder for the
pattern synonym: see recoverPSB.  The goal of the placeholder is not
to cause a raft of follow-on errors.  I've used the simplest thing for
now, but we might need to elaborate it a bit later.  (e.g.  I've given
it zero args, which may cause knock-on errors if it is used in a
pattern.) But it'll do for now.

-}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcInferPatSynDecl"><span class="hs-identifier hs-type">tcInferPatSynDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-143"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span id="tcInferPatSynDecl"><span class="annot"><span class="annottext">tcInferPatSynDecl :: PatSynBind GhcRn GhcRn -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcInferPatSynDecl"><span class="hs-identifier hs-var hs-var">tcInferPatSynDecl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095852"><span class="annot"><span class="annottext">lname :: GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095852"><span class="hs-identifier hs-var">lname</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095851"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681095851"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_args :: forall idL idR.
PatSynBind idL idR -&gt; HsPatSynDetails (Located (IdP idR))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095850"><span class="annot"><span class="annottext">HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095850"><span class="hs-identifier hs-var">details</span></a></span></span><span>
</span><span id="line-145"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_def :: forall idL idR. PatSynBind idL idR -&gt; LPat idR
</span><a href="GHC.Hs.Binds.html#psb_def"><span class="hs-identifier hs-var">psb_def</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095848"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095848"><span class="hs-identifier hs-var">lpat</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_dir :: forall idL idR. PatSynBind idL idR -&gt; HsPatSynDir idR
</span><a href="GHC.Hs.Binds.html#psb_dir"><span class="hs-identifier hs-var">psb_dir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095846"><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095846"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a. Located Name -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#addPatSynCtxt"><span class="hs-identifier hs-var">addPatSynCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095852"><span class="hs-identifier hs-var">lname</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv))
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcInferPatSynDecl {&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095851"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095842"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095842"><span class="hs-identifier hs-var">arg_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095841"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095841"><span class="hs-identifier hs-var">rec_fields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095840"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095840"><span class="hs-identifier hs-var">is_infix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name) -&gt; ([Name], [Name], Bool)
</span><a href="GHC.Tc.TyCl.PatSyn.html#collectPatSynArgInfo"><span class="hs-identifier hs-var">collectPatSynArgInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name)
HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095850"><span class="hs-identifier hs-var">details</span></a></span><span>
</span><span id="line-150"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095839"><span class="annot"><span class="annottext">TcLevel
</span><a href="#local-6989586621681095839"><span class="hs-identifier hs-var">tclvl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095838"><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095838"><span class="hs-identifier hs-var">wanted</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681095837"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681095837"><span class="hs-identifier hs-var">lpat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095836"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095836"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095835"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095835"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM ((Located (Pat GhcTc), [Id]), Kind)
-&gt; TcM
     (TcLevel, WantedConstraints, ((Located (Pat GhcTc), [Id]), Kind))
forall a. TcM a -&gt; TcM (TcLevel, WantedConstraints, a)
</span><a href="GHC.Tc.Utils.Monad.html#pushLevelAndCaptureConstraints"><span class="hs-identifier hs-var">pushLevelAndCaptureConstraints</span></a></span><span>  </span><span class="annot"><span class="annottext">(TcM ((Located (Pat GhcTc), [Id]), Kind)
 -&gt; TcM
      (TcLevel, WantedConstraints, ((Located (Pat GhcTc), [Id]), Kind)))
-&gt; TcM ((Located (Pat GhcTc), [Id]), Kind)
-&gt; TcM
     (TcLevel, WantedConstraints, ((Located (Pat GhcTc), [Id]), Kind))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-152"></span><span>               </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; TcM [Id] -&gt; TcM ((LPat GhcTc, [Id]), Kind)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; TcM a -&gt; TcM ((LPat GhcTc, a), Kind)
</span><a href="GHC.Tc.Gen.Pat.html#tcInferPat"><span class="hs-identifier hs-var">tcInferPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatSyn"><span class="hs-identifier hs-var">PatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095848"><span class="hs-identifier hs-var">lpat</span></a></span><span>          </span><span class="annot"><span class="annottext">(TcM [Id] -&gt; TcM ((LPat GhcTc, [Id]), Kind))
-&gt; TcM [Id] -&gt; TcM ((LPat GhcTc, [Id]), Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-153"></span><span>               </span><span class="annot"><span class="annottext">(Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id) -&gt; [Name] -&gt; TcM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
</span><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier hs-var">tcLookupId</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095842"><span class="hs-identifier hs-var">arg_names</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095829"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095829"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095828"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095828"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcCollectEx"><span class="hs-identifier hs-var">tcCollectEx</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095837"><span class="hs-identifier hs-var">lpat'</span></a></span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span>             </span><span id="local-6989586621681095826"><span class="annot"><span class="annottext">named_taus :: [(Name, Kind)]
</span><a href="#local-6989586621681095826"><span class="hs-identifier hs-var hs-var">named_taus</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095851"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095835"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Name, Kind) -&gt; [(Name, Kind)] -&gt; [(Name, Kind)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; (Name, Kind)) -&gt; [Id] -&gt; [(Name, Kind)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; (Name, Kind)
</span><a href="#local-6989586621681095825"><span class="hs-identifier hs-var">mk_named_tau</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095836"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-158"></span><span>             </span><span id="local-6989586621681095825"><span class="annot"><span class="annottext">mk_named_tau :: Id -&gt; (Name, Kind)
</span><a href="#local-6989586621681095825"><span class="hs-identifier hs-var hs-var">mk_named_tau</span></a></span></span><span> </span><span id="local-6989586621681095824"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095824"><span class="hs-identifier hs-var">arg</span></a></span></span><span>
</span><span id="line-159"></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
forall a. NamedThing a =&gt; a -&gt; Name
</span><a href="GHC.Types.Name.html#getName"><span class="hs-identifier hs-var">getName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095824"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#mkSpecForAllTys"><span class="hs-identifier hs-var">mkSpecForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095829"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095824"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>               </span><span class="hs-comment">-- The mkSpecForAllTys is important (#14552), albeit</span><span>
</span><span id="line-161"></span><span>               </span><span class="hs-comment">-- slightly artificial (there is no variable with this funny type).</span><span>
</span><span id="line-162"></span><span>               </span><span class="hs-comment">-- We do not want to quantify over variable (alpha::k)</span><span>
</span><span id="line-163"></span><span>               </span><span class="hs-comment">-- that mention the existentially-bound type variables</span><span>
</span><span id="line-164"></span><span>               </span><span class="hs-comment">-- ex_tvs in its kind k.</span><span>
</span><span id="line-165"></span><span>               </span><span class="hs-comment">-- See Note [Type variables whose kind is captured]</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095821"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095821"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095820"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095820"><span class="hs-identifier hs-var">req_dicts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095819"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095819"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095818"><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095818"><span class="hs-identifier hs-var">residual</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcLevel
-&gt; InferMode
-&gt; [TcIdSigInst]
-&gt; [(Name, Kind)]
-&gt; WantedConstraints
-&gt; TcM ([Id], [Id], TcEvBinds, WantedConstraints, Bool)
</span><a href="GHC.Tc.Solver.html#simplifyInfer"><span class="hs-identifier hs-var">simplifyInfer</span></a></span><span> </span><span class="annot"><span class="annottext">TcLevel
</span><a href="#local-6989586621681095839"><span class="hs-identifier hs-var">tclvl</span></a></span><span> </span><span class="annot"><span class="annottext">InferMode
</span><a href="GHC.Tc.Solver.html#NoRestrictions"><span class="hs-identifier hs-var">NoRestrictions</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[(Name, Kind)]
</span><a href="#local-6989586621681095826"><span class="hs-identifier hs-var">named_taus</span></a></span><span> </span><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095838"><span class="hs-identifier hs-var">wanted</span></a></span><span>
</span><span id="line-169"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095815"><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681095815"><span class="hs-identifier hs-var">top_ev_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM (Bag EvBind) -&gt; TcM (Bag EvBind)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WantedConstraints -&gt; TcM (Bag EvBind)
</span><a href="GHC.Tc.Solver.html#simplifyTop"><span class="hs-identifier hs-var">simplifyTop</span></a></span><span> </span><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095818"><span class="hs-identifier hs-var">residual</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bag EvBind
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a. Bag EvBind -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addTopEvBinds"><span class="hs-identifier hs-var">addTopEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681095815"><span class="hs-identifier hs-var">top_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv))
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095811"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095811"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id) -&gt; [Id] -&gt; TcM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
</span><a href="GHC.Tc.Utils.TcMType.html#zonkId"><span class="hs-identifier hs-var">zonkId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095828"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span>
</span><span id="line-173"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095809"><span class="annot"><span class="annottext">filtered_prov_dicts :: [Id]
</span><a href="#local-6989586621681095809"><span class="hs-identifier hs-var hs-var">filtered_prov_dicts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Kind) -&gt; [a] -&gt; [a]
</span><a href="GHC.Tc.Utils.TcType.html#mkMinimalBySCs"><span class="hs-identifier hs-var">mkMinimalBySCs</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#evVarPred"><span class="hs-identifier hs-var">evVarPred</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095811"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span>
</span><span id="line-174"></span><span>             </span><span class="hs-comment">-- Filtering: see Note [Remove redundant provided dicts]</span><span>
</span><span id="line-175"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681095806"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095806"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095805"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095805"><span class="hs-identifier hs-var">prov_evs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Kind, EvTerm)] -&gt; ([Kind], [EvTerm])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Maybe (Kind, EvTerm)) -&gt; [Id] -&gt; [(Kind, EvTerm)]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe (Kind, EvTerm)
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkProvEvidence"><span class="hs-identifier hs-var">mkProvEvidence</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095809"><span class="hs-identifier hs-var">filtered_prov_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>             </span><span id="local-6989586621681095802"><span class="annot"><span class="annottext">req_theta :: [Kind]
</span><a href="#local-6989586621681095802"><span class="hs-identifier hs-var hs-var">req_theta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; [Id] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#evVarPred"><span class="hs-identifier hs-var">evVarPred</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095820"><span class="hs-identifier hs-var">req_dicts</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span>       </span><span class="hs-comment">-- Report coercions that escape</span><span>
</span><span id="line-180"></span><span>       </span><span class="hs-comment">-- See Note [Coercions that escape]</span><span>
</span><span id="line-181"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095801"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095801"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id) -&gt; [Id] -&gt; TcM [Id]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
</span><a href="GHC.Tc.Utils.TcMType.html#zonkId"><span class="hs-identifier hs-var">zonkId</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095836"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-182"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095800"><span class="annot"><span class="annottext">bad_args :: [(Id, DVarSet)]
</span><a href="#local-6989586621681095800"><span class="hs-identifier hs-var hs-var">bad_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095799"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DVarSet
</span><a href="#local-6989586621681095798"><span class="hs-identifier hs-var">bad_cos</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681095799"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095799"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095801"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [Id]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095811"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span>
</span><span id="line-183"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095798"><span class="annot"><span class="annottext">bad_cos :: DVarSet
</span><a href="#local-6989586621681095798"><span class="hs-identifier hs-var hs-var">bad_cos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; DVarSet -&gt; DVarSet
</span><a href="GHC.Types.Var.Set.html#filterDVarSet"><span class="hs-identifier hs-var">filterDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">(DVarSet -&gt; DVarSet) -&gt; DVarSet -&gt; DVarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-184"></span><span>                                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; DVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeDSet"><span class="hs-identifier hs-var">tyCoVarsOfTypeDSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095799"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DVarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#isEmptyDVarSet"><span class="hs-identifier hs-var">isEmptyDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">DVarSet
</span><a href="#local-6989586621681095798"><span class="hs-identifier hs-var">bad_cos</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-186"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((Id, DVarSet) -&gt; TcRn ()) -&gt; [(Id, DVarSet)] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, DVarSet) -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.PatSyn.html#dependentArgErr"><span class="hs-identifier hs-var">dependentArgErr</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, DVarSet)]
</span><a href="#local-6989586621681095800"><span class="hs-identifier hs-var">bad_args</span></a></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcInferPatSynDecl }&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095851"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095829"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; HsPatSynDir GhcRn
-&gt; Bool
-&gt; LPat GhcTc
-&gt; ([VarBndr Id Specificity], [Kind], TcEvBinds, [Id])
-&gt; ([VarBndr Id Specificity], [Kind], [Kind], [EvTerm])
-&gt; ([LHsExpr GhcTc], [Kind])
-&gt; Kind
-&gt; [Name]
-&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tc_patsyn_finish"><span class="hs-identifier hs-var">tc_patsyn_finish</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095852"><span class="hs-identifier hs-var">lname</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095846"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095840"><span class="hs-identifier hs-var">is_infix</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095837"><span class="hs-identifier hs-var">lpat'</span></a></span><span>
</span><span id="line-190"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Specificity -&gt; [Id] -&gt; [VarBndr Id Specificity]
forall vis. vis -&gt; [Id] -&gt; [VarBndr Id vis]
</span><a href="GHC.Types.Var.html#mkTyVarBinders"><span class="hs-identifier hs-var">mkTyVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095821"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span>
</span><span id="line-191"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095802"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095819"><span class="hs-identifier hs-var">ev_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095820"><span class="hs-identifier hs-var">req_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Specificity -&gt; [Id] -&gt; [VarBndr Id Specificity]
forall vis. vis -&gt; [Id] -&gt; [VarBndr Id vis]
</span><a href="GHC.Types.Var.html#mkTyVarBinders"><span class="hs-identifier hs-var">mkTyVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">Specificity
</span><a href="GHC.Types.Var.html#InferredSpec"><span class="hs-identifier hs-var">InferredSpec</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095829"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span>
</span><span id="line-193"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095829"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095806"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095805"><span class="hs-identifier hs-var">prov_evs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; LHsExpr GhcTc) -&gt; [Id] -&gt; [LHsExpr GhcTc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095801"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Kind) -&gt; [Id] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095801"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>                          </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095835"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095841"><span class="hs-identifier hs-var">rec_fields</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#mkProvEvidence"><span class="hs-identifier hs-type">mkProvEvidence</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvId"><span class="hs-identifier hs-type">EvId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- See Note [Equality evidence in pattern synonyms]</span><span>
</span><span id="line-199"></span><span id="mkProvEvidence"><span class="annot"><span class="annottext">mkProvEvidence :: Id -&gt; Maybe (Kind, EvTerm)
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkProvEvidence"><span class="hs-identifier hs-var hs-var">mkProvEvidence</span></a></span></span><span> </span><span id="local-6989586621681095781"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095781"><span class="hs-identifier hs-var">ev_id</span></a></span></span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html#EqPred"><span class="hs-identifier hs-type">EqPred</span></a></span><span> </span><span id="local-6989586621681095779"><span class="annot"><span class="annottext">EqRel
</span><a href="#local-6989586621681095779"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621681095778"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095778"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621681095777"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095777"><span class="hs-identifier hs-var">ty2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Pred
</span><a href="GHC.Core.Predicate.html#classifyPredType"><span class="hs-identifier hs-var">classifyPredType</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095775"><span class="hs-identifier hs-var">pred</span></a></span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095774"><span class="annot"><span class="annottext">k1 :: Kind
</span><a href="#local-6989586621681095774"><span class="hs-identifier hs-var hs-var">k1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind
Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#tcTypeKind"><span class="hs-identifier hs-var">tcTypeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095778"><span class="hs-identifier hs-var">ty1</span></a></span><span>
</span><span id="line-202"></span><span>        </span><span id="local-6989586621681095772"><span class="annot"><span class="annottext">k2 :: Kind
</span><a href="#local-6989586621681095772"><span class="hs-identifier hs-var hs-var">k2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind
Kind -&gt; Kind
</span><a href="GHC.Core.Type.html#tcTypeKind"><span class="hs-identifier hs-var">tcTypeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095777"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-203"></span><span>        </span><span id="local-6989586621681095771"><span class="annot"><span class="annottext">is_homo :: Bool
</span><a href="#local-6989586621681095771"><span class="hs-identifier hs-var hs-var">is_homo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095774"><span class="hs-identifier hs-var">k1</span></a></span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Kind -&gt; Bool
Kind -&gt; Kind -&gt; Bool
</span><a href="GHC.Tc.Utils.TcType.html#tcEqType"><span class="hs-operator hs-var">`tcEqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095772"><span class="hs-identifier hs-var">k2</span></a></span><span>
</span><span id="line-204"></span><span>        </span><span id="local-6989586621681095769"><span class="annot"><span class="annottext">homo_tys :: [Kind]
</span><a href="#local-6989586621681095769"><span class="hs-identifier hs-var hs-var">homo_tys</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095774"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095778"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095777"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-205"></span><span>        </span><span id="local-6989586621681095768"><span class="annot"><span class="annottext">hetero_tys :: [Kind]
</span><a href="#local-6989586621681095768"><span class="hs-identifier hs-var hs-var">hetero_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095774"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095772"><span class="hs-identifier hs-var">k2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095778"><span class="hs-identifier hs-var">ty1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095777"><span class="hs-identifier hs-var">ty2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">EqRel
</span><a href="#local-6989586621681095779"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-207"></span><span>      </span><span class="annot"><span class="annottext">EqRel
</span><a href="GHC.Core.Predicate.html#ReprEq"><span class="hs-identifier hs-var">ReprEq</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095771"><span class="hs-identifier hs-var">is_homo</span></a></span><span>
</span><span id="line-208"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Kind, EvTerm) -&gt; Maybe (Kind, EvTerm)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Kind] -&gt; Kind
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="GHC.Builtin.Types.html#coercibleClass"><span class="hs-identifier hs-var">coercibleClass</span></a></span><span>    </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095769"><span class="hs-identifier hs-var">homo_tys</span></a></span><span>
</span><span id="line-209"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Kind] -&gt; [EvExpr] -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#evDataConApp"><span class="hs-identifier hs-var">evDataConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#coercibleDataCon"><span class="hs-identifier hs-var">coercibleDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095769"><span class="hs-identifier hs-var">homo_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[EvExpr]
</span><a href="#local-6989586621681095762"><span class="hs-identifier hs-var">eq_con_args</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Kind, EvTerm)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-211"></span><span>      </span><span class="annot"><span class="annottext">EqRel
</span><a href="GHC.Core.Predicate.html#NomEq"><span class="hs-identifier hs-var">NomEq</span></a></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095771"><span class="hs-identifier hs-var">is_homo</span></a></span><span>
</span><span id="line-212"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Kind, EvTerm) -&gt; Maybe (Kind, EvTerm)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Kind] -&gt; Kind
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="GHC.Builtin.Types.html#eqClass"><span class="hs-identifier hs-var">eqClass</span></a></span><span>    </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095769"><span class="hs-identifier hs-var">homo_tys</span></a></span><span>
</span><span id="line-213"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Kind] -&gt; [EvExpr] -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#evDataConApp"><span class="hs-identifier hs-var">evDataConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#eqDataCon"><span class="hs-identifier hs-var">eqDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095769"><span class="hs-identifier hs-var">homo_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[EvExpr]
</span><a href="#local-6989586621681095762"><span class="hs-identifier hs-var">eq_con_args</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-215"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Kind, EvTerm) -&gt; Maybe (Kind, EvTerm)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Kind] -&gt; Kind
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="GHC.Builtin.Types.html#heqClass"><span class="hs-identifier hs-var">heqClass</span></a></span><span>    </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095768"><span class="hs-identifier hs-var">hetero_tys</span></a></span><span>
</span><span id="line-216"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [Kind] -&gt; [EvExpr] -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#evDataConApp"><span class="hs-identifier hs-var">evDataConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#heqDataCon"><span class="hs-identifier hs-var">heqDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095768"><span class="hs-identifier hs-var">hetero_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[EvExpr]
</span><a href="#local-6989586621681095762"><span class="hs-identifier hs-var">eq_con_args</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Kind, EvTerm) -&gt; Maybe (Kind, EvTerm)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095775"><span class="hs-identifier hs-var">pred</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvExpr -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-var">EvExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; EvExpr
</span><a href="GHC.Tc.Types.Evidence.html#evId"><span class="hs-identifier hs-var">evId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095781"><span class="hs-identifier hs-var">ev_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621681095775"><span class="annot"><span class="annottext">pred :: Kind
</span><a href="#local-6989586621681095775"><span class="hs-identifier hs-var hs-var">pred</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#evVarPred"><span class="hs-identifier hs-var">evVarPred</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095781"><span class="hs-identifier hs-var">ev_id</span></a></span><span>
</span><span id="line-222"></span><span>    </span><span id="local-6989586621681095762"><span class="annot"><span class="annottext">eq_con_args :: [EvExpr]
</span><a href="#local-6989586621681095762"><span class="hs-identifier hs-var hs-var">eq_con_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; EvExpr
</span><a href="GHC.Tc.Types.Evidence.html#evId"><span class="hs-identifier hs-var">evId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095781"><span class="hs-identifier hs-var">ev_id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#dependentArgErr"><span class="hs-identifier hs-type">dependentArgErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyCoVarSet"><span class="hs-identifier hs-type">DTyCoVarSet</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span class="hs-comment">-- See Note [Coercions that escape]</span><span>
</span><span id="line-226"></span><span id="dependentArgErr"><span class="annot"><span class="annottext">dependentArgErr :: (Id, DVarSet) -&gt; TcRn ()
</span><a href="GHC.Tc.TyCl.PatSyn.html#dependentArgErr"><span class="hs-identifier hs-var hs-var">dependentArgErr</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095753"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095753"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095752"><span class="annot"><span class="annottext">DVarSet
</span><a href="#local-6989586621681095752"><span class="hs-identifier hs-var">bad_cos</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrTc"><span class="hs-identifier hs-var">addErrTc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Iceland Jack!  Iceland Jack! Stop torturing me!&quot;</span></span><span>
</span><span id="line-229"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern-bound variable&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>              </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095753"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095753"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; MsgDoc -&gt; MsgDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-232"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;has a type that mentions pattern-bound coercion&quot;</span></span><span>
</span><span id="line-233"></span><span>                 </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; MsgDoc
forall a. [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#plural"><span class="hs-identifier hs-var">plural</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095742"><span class="hs-identifier hs-var">bad_co_list</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>              </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; MsgDoc) -&gt; [Id] -&gt; MsgDoc
forall a. (a -&gt; MsgDoc) -&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#pprWithCommas"><span class="hs-identifier hs-var">pprWithCommas</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095742"><span class="hs-identifier hs-var">bad_co_list</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Hint: use -fprint-explicit-coercions to see the coercions&quot;</span></span><span>
</span><span id="line-236"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Probable fix: add a pattern signature&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-238"></span><span>    </span><span id="local-6989586621681095742"><span class="annot"><span class="annottext">bad_co_list :: [Id]
</span><a href="#local-6989586621681095742"><span class="hs-identifier hs-var hs-var">bad_co_list</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DVarSet -&gt; [Id]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span> </span><span class="annot"><span class="annottext">DVarSet
</span><a href="#local-6989586621681095752"><span class="hs-identifier hs-var">bad_cos</span></a></span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span class="hs-comment">{- Note [Type variables whose kind is captured]
~~-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
  data AST a = Sym [a]
  class Prj s where { prj :: [a] -&gt; Maybe (s a) }
  pattern P x &lt;= Sym (prj -&gt; Just x)

Here we get a matcher with this type
  $mP :: forall s a. Prj s =&gt; AST a -&gt; (s a -&gt; r) -&gt; r -&gt; r

No problem.  But note that 's' is not fixed by the type of the
pattern (AST a), nor is it existentially bound.  It's really only
fixed by the type of the continuation.

#14552 showed that this can go wrong if the kind of 's' mentions
existentially bound variables.  We obviously can't make a type like
  $mP :: forall (s::k-&gt;*) a. Prj s =&gt; AST a -&gt; (forall k. s a -&gt; r)
                                   -&gt; r -&gt; r
But neither is 's' itself existentially bound, so the forall (s::k-&gt;*)
can't go in the inner forall either.  (What would the matcher apply
the continuation to?)

Solution: do not quantiify over any unification variable whose kind
mentions the existentials.  We can conveniently do that by making the
&quot;taus&quot; passed to simplifyInfer look like
   forall ex_tvs. arg_ty

After that, Note [Naughty quantification candidates] in GHC.Tc.Utils.TcMType takes
over and errors.

Note [Remove redundant provided dicts]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recall that
   HRefl :: forall k1 k2 (a1:k1) (a2:k2). (k1 ~ k2, a1 ~ a2)
                                       =&gt; a1 :~~: a2
(NB: technically the (k1~k2) existential dictionary is not necessary,
but it's there at the moment.)

Now consider (#14394):
   pattern Foo = HRefl
in a non-poly-kinded module.  We don't want to get
    pattern Foo :: () =&gt; (* ~ *, b ~ a) =&gt; a :~~: b
with that redundant (* ~ *).  We'd like to remove it; hence the call to
mkMinimalWithSCs.

Similarly consider
  data S a where { MkS :: Ord a =&gt; a -&gt; S a }
  pattern Bam x y &lt;- (MkS (x::a), MkS (y::a)))

The pattern (Bam x y) binds two (Ord a) dictionaries, but we only
need one.  Again mkMimimalWithSCs removes the redundant one.

Note [Equality evidence in pattern synonyms]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
  data X a where
     MkX :: Eq a =&gt; [a] -&gt; X (Maybe a)
  pattern P x = MkG x

Then there is a danger that GHC will infer
  P :: forall a.  () =&gt;
       forall b. (a ~# Maybe b, Eq b) =&gt; [b] -&gt; X a

The 'builder' for P, which is called in user-code, will then
have type
  $bP :: forall a b. (a ~# Maybe b, Eq b) =&gt; [b] -&gt; X a

and that is bad because (a ~# Maybe b) is not a predicate type
(see Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep
and is not implicitly instantiated.

So in mkProvEvidence we lift (a ~# b) to (a ~ b).  Tiresome, and
marginally less efficient, if the builder/martcher are not inlined.

See also Note [Lift equality constraints when quantifying] in GHC.Tc.Utils.TcType

Note [Coercions that escape]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#14507 showed an example where the inferred type of the matcher
for the pattern synonym was something like
   $mSO :: forall (r :: TYPE rep) kk (a :: k).
           TypeRep k a
           -&gt; ((Bool ~ k) =&gt; TypeRep Bool (a |&gt; co_a2sv) -&gt; r)
           -&gt; (Void# -&gt; r)
           -&gt; r

What is that co_a2sv :: Bool ~# *??  It was bound (via a superclass
selection) by the pattern being matched; and indeed it is implicit in
the context (Bool ~ k).  You could imagine trying to extract it like
this:
   $mSO :: forall (r :: TYPE rep) kk (a :: k).
           TypeRep k a
           -&gt; ( co :: ((Bool :: *) ~ (k :: *)) =&gt;
                  let co_a2sv = sc_sel co
                  in TypeRep Bool (a |&gt; co_a2sv) -&gt; r)
           -&gt; (Void# -&gt; r)
           -&gt; r

But we simply don't allow that in types.  Maybe one day but not now.

How to detect this situation?  We just look for free coercion variables
in the types of any of the arguments to the matcher.  The error message
is not very helpful, but at least we don't get a Lint error.
-}</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcCheckPatSynDecl"><span class="hs-identifier hs-type">tcCheckPatSynDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-346"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcPatSynInfo"><span class="hs-identifier hs-type">TcPatSynInfo</span></a></span><span>
</span><span id="line-347"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-348"></span><span id="tcCheckPatSynDecl"><span class="annot"><span class="annottext">tcCheckPatSynDecl :: PatSynBind GhcRn GhcRn
-&gt; TcPatSynInfo -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcCheckPatSynDecl"><span class="hs-identifier hs-var hs-var">tcCheckPatSynDecl</span></a></span></span><span> </span><span id="local-6989586621681095738"><span class="annot"><span class="annottext">psb :: PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095738"><span class="hs-identifier hs-var">psb</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095737"><span class="annot"><span class="annottext">lname :: GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095737"><span class="hs-identifier hs-var">lname</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095736"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681095736"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_args :: forall idL idR.
PatSynBind idL idR -&gt; HsPatSynDetails (Located (IdP idR))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095735"><span class="annot"><span class="annottext">HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095735"><span class="hs-identifier hs-var">details</span></a></span></span><span>
</span><span id="line-349"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_def :: forall idL idR. PatSynBind idL idR -&gt; LPat idR
</span><a href="GHC.Hs.Binds.html#psb_def"><span class="hs-identifier hs-var">psb_def</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095734"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095734"><span class="hs-identifier hs-var">lpat</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_dir :: forall idL idR. PatSynBind idL idR -&gt; HsPatSynDir idR
</span><a href="GHC.Hs.Binds.html#psb_dir"><span class="hs-identifier hs-var">psb_dir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095733"><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095733"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-350"></span><span>                  </span><span class="annot"><a href="GHC.Tc.Types.html#TPSI"><span class="hs-identifier hs-type">TPSI</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">patsig_implicit_bndrs :: TcPatSynInfo -&gt; [VarBndr Id Specificity]
</span><a href="GHC.Tc.Types.html#patsig_implicit_bndrs"><span class="hs-identifier hs-var">patsig_implicit_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095730"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095730"><span class="hs-identifier hs-var">implicit_bndrs</span></a></span></span><span>
</span><span id="line-351"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_univ_bndrs :: TcPatSynInfo -&gt; [VarBndr Id Specificity]
</span><a href="GHC.Tc.Types.html#patsig_univ_bndrs"><span class="hs-identifier hs-var">patsig_univ_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095728"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095728"><span class="hs-identifier hs-var">explicit_univ_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_prov :: TcPatSynInfo -&gt; [Kind]
</span><a href="GHC.Tc.Types.html#patsig_prov"><span class="hs-identifier hs-var">patsig_prov</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095726"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095726"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span>
</span><span id="line-352"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_ex_bndrs :: TcPatSynInfo -&gt; [VarBndr Id Specificity]
</span><a href="GHC.Tc.Types.html#patsig_ex_bndrs"><span class="hs-identifier hs-var">patsig_ex_bndrs</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095724"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095724"><span class="hs-identifier hs-var">explicit_ex_bndrs</span></a></span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">patsig_req :: TcPatSynInfo -&gt; [Kind]
</span><a href="GHC.Tc.Types.html#patsig_req"><span class="hs-identifier hs-var">patsig_req</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095722"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095722"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span>
</span><span id="line-353"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">patsig_body_ty :: TcPatSynInfo -&gt; Kind
</span><a href="GHC.Tc.Types.html#patsig_body_ty"><span class="hs-identifier hs-var">patsig_body_ty</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095720"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095720"><span class="hs-identifier hs-var">sig_body_ty</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-354"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a. Located Name -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#addPatSynCtxt"><span class="hs-identifier hs-var">addPatSynCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095737"><span class="hs-identifier hs-var">lname</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv))
-&gt; TcM (LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-355"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095719"><span class="annot"><span class="annottext">decl_arity :: Int
</span><a href="#local-6989586621681095719"><span class="hs-identifier hs-var hs-var">decl_arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095717"><span class="hs-identifier hs-var">arg_names</span></a></span><span>
</span><span id="line-356"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681095717"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095717"><span class="hs-identifier hs-var">arg_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095716"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095716"><span class="hs-identifier hs-var">rec_fields</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095715"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095715"><span class="hs-identifier hs-var">is_infix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name) -&gt; ([Name], [Name], Bool)
</span><a href="GHC.Tc.TyCl.PatSyn.html#collectPatSynArgInfo"><span class="hs-identifier hs-var">collectPatSynArgInfo</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name)
HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095735"><span class="hs-identifier hs-var">details</span></a></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcCheckPatSynDecl&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-359"></span><span>         </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095730"><span class="hs-identifier hs-var">implicit_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095728"><span class="hs-identifier hs-var">explicit_univ_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095722"><span class="hs-identifier hs-var">req_theta</span></a></span><span>
</span><span id="line-360"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095724"><span class="hs-identifier hs-var">explicit_ex_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095726"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095720"><span class="hs-identifier hs-var">sig_body_ty</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095714"><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681095714"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095713"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Kind -&gt; Either Int ([Scaled Kind], Kind)
</span><a href="GHC.Tc.Utils.TcType.html#tcSplitFunTysN"><span class="hs-identifier hs-var">tcSplitFunTysN</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095719"><span class="hs-identifier hs-var">decl_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095720"><span class="hs-identifier hs-var">sig_body_ty</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-363"></span><span>                                 </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681095711"><span class="annot"><span class="annottext">([Scaled Kind], Kind)
</span><a href="#local-6989586621681095711"><span class="hs-identifier hs-var">stuff</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([Scaled Kind], Kind)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([Scaled Kind], Kind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([Scaled Kind], Kind)
</span><a href="#local-6989586621681095711"><span class="hs-identifier hs-var">stuff</span></a></span><span>
</span><span id="line-364"></span><span>                                 </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681095710"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095710"><span class="hs-identifier hs-var">missing</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; Int
-&gt; Int
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([Scaled Kind], Kind)
forall a. Name -&gt; Int -&gt; Int -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#wrongNumberOfParmsErr"><span class="hs-identifier hs-var">wrongNumberOfParmsErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095736"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095719"><span class="hs-identifier hs-var">decl_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095710"><span class="hs-identifier hs-var">missing</span></a></span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span>       </span><span class="hs-comment">-- Complain about:  pattern P :: () =&gt; forall x. x -&gt; P x</span><span>
</span><span id="line-367"></span><span>       </span><span class="hs-comment">-- The existential 'x' should not appear in the result type</span><span>
</span><span id="line-368"></span><span>       </span><span class="hs-comment">-- Can't check this until we know P's arity</span><span>
</span><span id="line-369"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095708"><span class="annot"><span class="annottext">bad_tvs :: [Id]
</span><a href="#local-6989586621681095708"><span class="hs-identifier hs-var hs-var">bad_tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; [Id]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; [Id]) -&gt; [Id] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095724"><span class="hs-identifier hs-var">explicit_ex_bndrs</span></a></span><span>
</span><span id="line-370"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095708"><span class="hs-identifier hs-var">bad_tvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-371"></span><span>         </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The result type of the signature for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095736"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span>
</span><span id="line-372"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;namely&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>            </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mentions existential type variable&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; MsgDoc
forall a. [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#plural"><span class="hs-identifier hs-var">plural</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095708"><span class="hs-identifier hs-var">bad_tvs</span></a></span><span>
</span><span id="line-374"></span><span>               </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; MsgDoc
forall a. Outputable a =&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#pprQuotedList"><span class="hs-identifier hs-var">pprQuotedList</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095708"><span class="hs-identifier hs-var">bad_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span>         </span><span class="hs-comment">-- See Note [The pattern-synonym signature splitting rule] in GHC.Tc.Gen.Sig</span><span>
</span><span id="line-377"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095698"><span class="annot"><span class="annottext">univ_fvs :: VarSet
</span><a href="#local-6989586621681095698"><span class="hs-identifier hs-var hs-var">univ_fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKinds"><span class="hs-identifier hs-var">closeOverKinds</span></a></span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; VarSet -&gt; VarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-378"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Kind] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypes"><span class="hs-identifier hs-var">tyCoVarsOfTypes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; [Kind] -&gt; [Kind]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095722"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSetList"><span class="hs-operator hs-var">`extendVarSetList`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095728"><span class="hs-identifier hs-var">explicit_univ_bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681095694"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095694"><span class="hs-identifier hs-var">extra_univ</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095693"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095693"><span class="hs-identifier hs-var">extra_ex</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarBndr Id Specificity -&gt; Bool)
-&gt; [VarBndr Id Specificity]
-&gt; ([VarBndr Id Specificity], [VarBndr Id Specificity])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681095698"><span class="hs-identifier hs-var">univ_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool)
-&gt; (VarBndr Id Specificity -&gt; Id) -&gt; VarBndr Id Specificity -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">VarBndr Id Specificity -&gt; Id
forall tv argf. VarBndr tv argf -&gt; tv
</span><a href="GHC.Types.Var.html#binderVar"><span class="hs-identifier hs-var">binderVar</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095730"><span class="hs-identifier hs-var">implicit_bndrs</span></a></span><span>
</span><span id="line-380"></span><span>             </span><span id="local-6989586621681095690"><span class="annot"><span class="annottext">univ_bndrs :: [VarBndr Id Specificity]
</span><a href="#local-6989586621681095690"><span class="hs-identifier hs-var hs-var">univ_bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095694"><span class="hs-identifier hs-var">extra_univ</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
-&gt; [VarBndr Id Specificity] -&gt; [VarBndr Id Specificity]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095728"><span class="hs-identifier hs-var">explicit_univ_bndrs</span></a></span><span>
</span><span id="line-381"></span><span>             </span><span id="local-6989586621681095689"><span class="annot"><span class="annottext">ex_bndrs :: [VarBndr Id Specificity]
</span><a href="#local-6989586621681095689"><span class="hs-identifier hs-var hs-var">ex_bndrs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095693"><span class="hs-identifier hs-var">extra_ex</span></a></span><span>   </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
-&gt; [VarBndr Id Specificity] -&gt; [VarBndr Id Specificity]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095724"><span class="hs-identifier hs-var">explicit_ex_bndrs</span></a></span><span>
</span><span id="line-382"></span><span>             </span><span id="local-6989586621681095688"><span class="annot"><span class="annottext">univ_tvs :: [Id]
</span><a href="#local-6989586621681095688"><span class="hs-identifier hs-var hs-var">univ_tvs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095690"><span class="hs-identifier hs-var">univ_bndrs</span></a></span><span>
</span><span id="line-383"></span><span>             </span><span id="local-6989586621681095687"><span class="annot"><span class="annottext">ex_tvs :: [Id]
</span><a href="#local-6989586621681095687"><span class="hs-identifier hs-var hs-var">ex_tvs</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095689"><span class="hs-identifier hs-var">ex_bndrs</span></a></span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span>       </span><span class="hs-comment">-- Right!  Let's check the pattern against the signature</span><span>
</span><span id="line-386"></span><span>       </span><span class="hs-comment">-- See Note [Checking against a pattern signature]</span><span>
</span><span id="line-387"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095686"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095686"><span class="hs-identifier hs-var">req_dicts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.TcMType.html#newEvVars"><span class="hs-identifier hs-var">newEvVars</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095722"><span class="hs-identifier hs-var">req_theta</span></a></span><span>
</span><span id="line-388"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095684"><span class="annot"><span class="annottext">TcLevel
</span><a href="#local-6989586621681095684"><span class="hs-identifier hs-var">tclvl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095683"><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095683"><span class="hs-identifier hs-var">wanted</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095682"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681095682"><span class="hs-identifier hs-var">lpat'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095681"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095681"><span class="hs-identifier hs-var">ex_tvs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095680"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095680"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095679"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095679"><span class="hs-identifier hs-var">args'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-389"></span><span>           </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">equalLength</span><span> </span><span class="hs-identifier">arg_names</span><span> </span><span class="hs-identifier">arg_tys</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">name</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">arg_names</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">arg_tys</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span>           </span><span class="annot"><span class="annottext">TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (TcLevel, WantedConstraints,
      (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc])))
forall a. TcM a -&gt; TcM (TcLevel, WantedConstraints, a)
</span><a href="GHC.Tc.Utils.Monad.html#pushLevelAndCaptureConstraints"><span class="hs-identifier hs-var">pushLevelAndCaptureConstraints</span></a></span><span>   </span><span class="annot"><span class="annottext">(TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (TcLevel, WantedConstraints,
       (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))))
-&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (TcLevel, WantedConstraints,
      (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc])))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-391"></span><span>           </span><span class="annot"><span class="annottext">[Id]
-&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
-&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
forall r. [Id] -&gt; TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Env.html#tcExtendTyVarEnv"><span class="hs-identifier hs-var">tcExtendTyVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095688"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span>        </span><span class="annot"><span class="annottext">(TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
 -&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc])))
-&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
-&gt; TcM (Located (Pat GhcTc), ([Id], [EvTerm], [LHsExpr GhcTc]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-392"></span><span>           </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled Kind
-&gt; TcM ([Id], [EvTerm], [LHsExpr GhcTc])
-&gt; TcM (LPat GhcTc, ([Id], [EvTerm], [LHsExpr GhcTc]))
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Kind -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatSyn"><span class="hs-identifier hs-var">PatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095734"><span class="hs-identifier hs-var">lpat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; Scaled Kind
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="annottext">(TcM ([Id], [EvTerm], [LHsExpr GhcTc])
 -&gt; TcM (LPat GhcTc, ([Id], [EvTerm], [LHsExpr GhcTc])))
-&gt; TcM ([Id], [EvTerm], [LHsExpr GhcTc])
-&gt; TcM (LPat GhcTc, ([Id], [EvTerm], [LHsExpr GhcTc]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-393"></span><span>           </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095671"><span class="annot"><span class="annottext">in_scope :: InScopeSet
</span><a href="#local-6989586621681095671"><span class="hs-identifier hs-var hs-var">in_scope</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; InScopeSet
</span><a href="GHC.Types.Var.Env.html#mkInScopeSet"><span class="hs-identifier hs-var">mkInScopeSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095688"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span>                    </span><span id="local-6989586621681095669"><span class="annot"><span class="annottext">empty_subst :: TCvSubst
</span><a href="#local-6989586621681095669"><span class="hs-identifier hs-var hs-var">empty_subst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InScopeSet -&gt; TCvSubst
</span><a href="GHC.Core.TyCo.Subst.html#mkEmptyTCvSubst"><span class="hs-identifier hs-var">mkEmptyTCvSubst</span></a></span><span> </span><span class="annot"><span class="annottext">InScopeSet
</span><a href="#local-6989586621681095671"><span class="hs-identifier hs-var">in_scope</span></a></span><span>
</span><span id="line-395"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095667"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095667"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095666"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095666"><span class="hs-identifier hs-var">ex_tvs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TCvSubst -&gt; Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) (TCvSubst, Id))
-&gt; TCvSubst
-&gt; [Id]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (TCvSubst, [Id])
forall (m :: * -&gt; *) acc x y.
Monad m =&gt;
(acc -&gt; x -&gt; m (acc, y)) -&gt; acc -&gt; [x] -&gt; m (acc, [y])
</span><a href="GHC.Utils.Monad.html#mapAccumLM"><span class="hs-identifier hs-var">mapAccumLM</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst -&gt; Id -&gt; IOEnv (Env TcGblEnv TcLclEnv) (TCvSubst, Id)
</span><a href="GHC.Tc.Utils.TcMType.html#newMetaTyVarX"><span class="hs-identifier hs-var">newMetaTyVarX</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095669"><span class="hs-identifier hs-var">empty_subst</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095687"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span>
</span><span id="line-396"></span><span>                    </span><span class="hs-comment">-- newMetaTyVarX: see the &quot;Existential type variables&quot;</span><span>
</span><span id="line-397"></span><span>                    </span><span class="hs-comment">-- part of Note [Checking against a pattern signature]</span><span>
</span><span id="line-398"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcpatsyn1&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095663"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095663"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681095663"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095663"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095687"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcpatsyn2&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095661"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095661"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681095661"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095661"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095666"><span class="hs-identifier hs-var">ex_tvs'</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095660"><span class="annot"><span class="annottext">prov_theta' :: [Kind]
</span><a href="#local-6989586621681095660"><span class="hs-identifier hs-var hs-var">prov_theta'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasCallStack =&gt; TCvSubst -&gt; [Kind] -&gt; [Kind]
TCvSubst -&gt; [Kind] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Subst.html#substTheta"><span class="hs-identifier hs-var">substTheta</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095667"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095726"><span class="hs-identifier hs-var">prov_theta</span></a></span><span>
</span><span id="line-401"></span><span>                  </span><span class="hs-comment">-- Add univ_tvs to the in_scope set to</span><span>
</span><span id="line-402"></span><span>                  </span><span class="hs-comment">-- satisfy the substitution invariant. There's no need to</span><span>
</span><span id="line-403"></span><span>                  </span><span class="hs-comment">-- add 'ex_tvs' as they are already in the domain of the</span><span>
</span><span id="line-404"></span><span>                  </span><span class="hs-comment">-- substitution.</span><span>
</span><span id="line-405"></span><span>                  </span><span class="hs-comment">-- See also Note [The substitution invariant] in GHC.Core.TyCo.Subst.</span><span>
</span><span id="line-406"></span><span>              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095658"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095658"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) EvTerm)
-&gt; [Kind] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [EvTerm]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtOrigin -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) EvTerm
</span><a href="GHC.Tc.Utils.TcMType.html#emitWanted"><span class="hs-identifier hs-var">emitWanted</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#ProvCtxtOrigin"><span class="hs-identifier hs-var">ProvCtxtOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681095738"><span class="hs-identifier hs-var">psb</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095660"><span class="hs-identifier hs-var">prov_theta'</span></a></span><span>
</span><span id="line-407"></span><span>              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095655"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095655"><span class="hs-identifier hs-var">args'</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsExpr GhcTc))
-&gt; [Name]
-&gt; [Kind]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [LHsExpr GhcTc]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
-&gt; Name -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsExpr GhcTc)
</span><a href="#local-6989586621681095654"><span class="hs-identifier hs-var">tc_arg</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095667"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095717"><span class="hs-identifier hs-var">arg_names</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Scaled Kind -&gt; Kind) -&gt; [Scaled Kind] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Kind -&gt; Kind
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681095714"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], [EvTerm], [LHsExpr GhcTc])
-&gt; TcM ([Id], [EvTerm], [LHsExpr GhcTc])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095666"><span class="hs-identifier hs-var">ex_tvs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095658"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095655"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-409"></span><span>
</span><span id="line-410"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095652"><span class="annot"><span class="annottext">skol_info :: SkolemInfo
</span><a href="#local-6989586621681095652"><span class="hs-identifier hs-var hs-var">skol_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Kind -&gt; [(Name, Id)] -&gt; SkolemInfo
</span><a href="GHC.Tc.Types.Origin.html#SigSkol"><span class="hs-identifier hs-var">SigSkol</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#PatSynCtxt"><span class="hs-identifier hs-var">PatSynCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095736"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-411"></span><span>                         </span><span class="hs-comment">-- The type here is a bit bogus, but we do not print</span><span>
</span><span id="line-412"></span><span>                         </span><span class="hs-comment">-- the type for PatSynCtxt, so it doesn't matter</span><span>
</span><span id="line-413"></span><span>                         </span><span class="hs-comment">-- See Note [Skolem info for pattern synonyms] in &quot;GHC.Tc.Types.Origin&quot;</span><span>
</span><span id="line-414"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095649"><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681095649"><span class="hs-identifier hs-var">implics</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095648"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095648"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcLevel
-&gt; SkolemInfo
-&gt; [Id]
-&gt; [Id]
-&gt; WantedConstraints
-&gt; TcM (Bag Implication, TcEvBinds)
</span><a href="GHC.Tc.Utils.Unify.html#buildImplicationFor"><span class="hs-identifier hs-var">buildImplicationFor</span></a></span><span> </span><span class="annot"><span class="annottext">TcLevel
</span><a href="#local-6989586621681095684"><span class="hs-identifier hs-var">tclvl</span></a></span><span> </span><span class="annot"><span class="annottext">SkolemInfo
</span><a href="#local-6989586621681095652"><span class="hs-identifier hs-var">skol_info</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095688"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095686"><span class="hs-identifier hs-var">req_dicts</span></a></span><span> </span><span class="annot"><span class="annottext">WantedConstraints
</span><a href="#local-6989586621681095683"><span class="hs-identifier hs-var">wanted</span></a></span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span>       </span><span class="hs-comment">-- Solve the constraints now, because we are about to make a PatSyn,</span><span>
</span><span id="line-417"></span><span>       </span><span class="hs-comment">-- which should not contain unification variables and the like (#10997)</span><span>
</span><span id="line-418"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bag Implication -&gt; TcRn ()
</span><a href="GHC.Tc.Solver.html#simplifyTopImplic"><span class="hs-identifier hs-var">simplifyTopImplic</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Implication
</span><a href="#local-6989586621681095649"><span class="hs-identifier hs-var">implics</span></a></span><span>
</span><span id="line-419"></span><span>
</span><span id="line-420"></span><span>       </span><span class="hs-comment">-- ToDo: in the bidirectional case, check that the ex_tvs' are all distinct</span><span>
</span><span id="line-421"></span><span>       </span><span class="hs-comment">-- Otherwise we may get a type error when typechecking the builder,</span><span>
</span><span id="line-422"></span><span>       </span><span class="hs-comment">-- when that should be impossible</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcCheckPatSynDecl }&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095736"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-425"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; HsPatSynDir GhcRn
-&gt; Bool
-&gt; LPat GhcTc
-&gt; ([VarBndr Id Specificity], [Kind], TcEvBinds, [Id])
-&gt; ([VarBndr Id Specificity], [Kind], [Kind], [EvTerm])
-&gt; ([LHsExpr GhcTc], [Kind])
-&gt; Kind
-&gt; [Name]
-&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tc_patsyn_finish"><span class="hs-identifier hs-var">tc_patsyn_finish</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095737"><span class="hs-identifier hs-var">lname</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095733"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095715"><span class="hs-identifier hs-var">is_infix</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095682"><span class="hs-identifier hs-var">lpat'</span></a></span><span>
</span><span id="line-426"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095690"><span class="hs-identifier hs-var">univ_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095722"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095648"><span class="hs-identifier hs-var">ev_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095686"><span class="hs-identifier hs-var">req_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095689"><span class="hs-identifier hs-var">ex_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTys"><span class="hs-identifier hs-var">mkTyVarTys</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095681"><span class="hs-identifier hs-var">ex_tvs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095726"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095680"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-428"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095679"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Scaled Kind -&gt; Kind) -&gt; [Scaled Kind] -&gt; [Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled Kind -&gt; Kind
forall a. Scaled a -&gt; a
</span><a href="GHC.Core.TyCo.Rep.html#scaledThing"><span class="hs-identifier hs-var">scaledThing</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Kind]
</span><a href="#local-6989586621681095714"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>                          </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095713"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095716"><span class="hs-identifier hs-var">rec_fields</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-430"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-431"></span><span>    </span><span class="annot"><a href="#local-6989586621681095654"><span class="hs-identifier hs-type">tc_arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Subst.html#TCvSubst"><span class="hs-identifier hs-type">TCvSubst</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>    </span><span id="local-6989586621681095654"><span class="annot"><span class="annottext">tc_arg :: TCvSubst
-&gt; Name -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsExpr GhcTc)
</span><a href="#local-6989586621681095654"><span class="hs-identifier hs-var hs-var">tc_arg</span></a></span></span><span> </span><span id="local-6989586621681095644"><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095644"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span id="local-6989586621681095643"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095643"><span class="hs-identifier hs-var">arg_name</span></a></span></span><span> </span><span id="local-6989586621681095642"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095642"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span>
</span><span id="line-433"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>   </span><span class="hs-comment">-- Look up the variable actually bound by lpat</span><span>
</span><span id="line-434"></span><span>               </span><span class="hs-comment">-- and check that it has the expected type</span><span>
</span><span id="line-435"></span><span>             </span><span id="local-6989586621681095641"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095641"><span class="hs-identifier hs-var">arg_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
</span><a href="GHC.Tc.Utils.Env.html#tcLookupId"><span class="hs-identifier hs-var">tcLookupId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095643"><span class="hs-identifier hs-var">arg_name</span></a></span><span>
</span><span id="line-436"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095640"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681095640"><span class="hs-identifier hs-var">wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Kind -&gt; Kind -&gt; TcM HsWrapper
</span><a href="GHC.Tc.Utils.Unify.html#tcSubTypeSigma"><span class="hs-identifier hs-var">tcSubTypeSigma</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#GenSigCtxt"><span class="hs-identifier hs-var">GenSigCtxt</span></a></span><span>
</span><span id="line-437"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095641"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-438"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Subst.html#substTyUnchecked"><span class="hs-identifier hs-var">substTyUnchecked</span></a></span><span> </span><span class="annot"><span class="annottext">TCvSubst
</span><a href="#local-6989586621681095644"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095642"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>                </span><span class="hs-comment">-- Why do we need tcSubType here?</span><span>
</span><span id="line-440"></span><span>                </span><span class="hs-comment">-- See Note [Pattern synonyms and higher rank types]</span><span>
</span><span id="line-441"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkLHsWrap"><span class="hs-identifier hs-var">mkLHsWrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681095640"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; LHsExpr GhcTc) -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IdP GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681095641"><span class="hs-identifier hs-var">arg_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="hs-comment">{- [Pattern synonyms and higher rank types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
  data T = MkT (forall a. a-&gt;a)

  pattern P :: (Int -&gt; Int) -&gt; T
  pattern P x &lt;- MkT x

This should work.  But in the matcher we must match against MkT, and then
instantiate its argument 'x', to get a function of type (Int -&gt; Int).
Equality is not enough!  #13752 was an example.


Note [The pattern-synonym signature splitting rule]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Given a pattern signature, we must split
     the kind-generalised variables, and
     the implicitly-bound variables
into universal and existential.  The rule is this
(see discussion on #11224):

     The universal tyvars are the ones mentioned in
          - univ_tvs: the user-specified (forall'd) universals
          - req_theta
          - res_ty
     The existential tyvars are all the rest

For example

   pattern P :: () =&gt; b -&gt; T a
   pattern P x = ...

Here 'a' is universal, and 'b' is existential.  But there is a wrinkle:
how do we split the arg_tys from req_ty?  Consider

   pattern Q :: () =&gt; b -&gt; S c -&gt; T a
   pattern Q x = ...

This is an odd example because Q has only one syntactic argument, and
so presumably is defined by a view pattern matching a function.  But
it can happen (#11977, #12108).

We don't know Q's arity from the pattern signature, so we have to wait
until we see the pattern declaration itself before deciding res_ty is,
and hence which variables are existential and which are universal.

And that in turn is why TcPatSynInfo has a separate field,
patsig_implicit_bndrs, to capture the implicitly bound type variables,
because we don't yet know how to split them up.

It's a slight compromise, because it means we don't really know the
pattern synonym's real signature until we see its declaration.  So,
for example, in hs-boot file, we may need to think what to do...
(eg don't have any implicitly-bound variables).


Note [Checking against a pattern signature]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When checking the actual supplied pattern against the pattern synonym
signature, we need to be quite careful.

----- Provided constraints
Example

    data T a where
      MkT :: Ord a =&gt; a -&gt; T a

    pattern P :: () =&gt; Eq a =&gt; a -&gt; [T a]
    pattern P x = [MkT x]

We must check that the (Eq a) that P claims to bind (and to
make available to matches against P), is derivable from the
actual pattern.  For example:
    f (P (x::a)) = ...here (Eq a) should be available...
And yes, (Eq a) is derivable from the (Ord a) bound by P's rhs.

----- Existential type variables
Unusually, we instantiate the existential tyvars of the pattern with
*meta* type variables.  For example

    data S where
      MkS :: Eq a =&gt; [a] -&gt; S

    pattern P :: () =&gt; Eq x =&gt; x -&gt; S
    pattern P x &lt;- MkS x

The pattern synonym conceals from its client the fact that MkS has a
list inside it.  The client just thinks it's a type 'x'.  So we must
unify x := [a] during type checking, and then use the instantiating type
[a] (called ex_tys) when building the matcher.  In this case we'll get

   $mP :: S -&gt; (forall x. Ex x =&gt; x -&gt; r) -&gt; r -&gt; r
   $mP x k = case x of
               MkS a (d:Eq a) (ys:[a]) -&gt; let dl :: Eq [a]
                                              dl = $dfunEqList d
                                          in k [a] dl ys

All this applies when type-checking the /matching/ side of
a pattern synonym.  What about the /building/ side?

* For Unidirectional, there is no builder

* For ExplicitBidirectional, the builder is completely separate
  code, typechecked in tcPatSynBuilderBind

* For ImplicitBidirectional, the builder is still typechecked in
  tcPatSynBuilderBind, by converting the pattern to an expression and
  typechecking it.

  At one point, for ImplicitBidirectional I used TyVarTvs (instead of
  TauTvs) in tcCheckPatSynDecl.  But (a) strengthening the check here
  is redundant since tcPatSynBuilderBind does the job, (b) it was
  still incomplete (TyVarTvs can unify with each other), and (c) it
  didn't even work (#13441 was accepted with
  ExplicitBidirectional, but rejected if expressed in
  ImplicitBidirectional form.  Conclusion: trying to be too clever is
  a bad idea.
-}</span><span>
</span><span id="line-561"></span><span>
</span><span id="line-562"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#collectPatSynArgInfo"><span class="hs-identifier hs-type">collectPatSynArgInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsPatSynDetails"><span class="hs-identifier hs-type">HsPatSynDetails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-563"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span id="collectPatSynArgInfo"><span class="annot"><span class="annottext">collectPatSynArgInfo :: HsPatSynDetails (Located Name) -&gt; ([Name], [Name], Bool)
</span><a href="GHC.Tc.TyCl.PatSyn.html#collectPatSynArgInfo"><span class="hs-identifier hs-var hs-var">collectPatSynArgInfo</span></a></span></span><span> </span><span id="local-6989586621681095635"><span class="annot"><span class="annottext">HsPatSynDetails (Located Name)
</span><a href="#local-6989586621681095635"><span class="hs-identifier hs-var">details</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-565"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located Name)
</span><a href="#local-6989586621681095635"><span class="hs-identifier hs-var">details</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-566"></span><span>    </span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span id="local-6989586621681095633"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681095633"><span class="hs-identifier hs-var">names</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name) -&gt; [Located Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681095633"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-567"></span><span>    </span><span class="annot"><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-type">InfixCon</span></a></span><span> </span><span id="local-6989586621681095630"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095630"><span class="hs-identifier hs-var">name1</span></a></span></span><span> </span><span id="local-6989586621681095629"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095629"><span class="hs-identifier hs-var">name2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name) -&gt; [Located Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095630"><span class="hs-identifier hs-var">name1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095629"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-568"></span><span>    </span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681095627"><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681095627"><span class="hs-identifier hs-var">names</span></a></span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095626"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095625"><span class="hs-identifier hs-var">sels</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span>                         </span><span class="hs-keyword">where</span><span>
</span><span id="line-570"></span><span>                            </span><span class="hs-special">(</span><span id="local-6989586621681095626"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095626"><span class="hs-identifier hs-var">vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095625"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095625"><span class="hs-identifier hs-var">sels</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Name)] -&gt; ([Name], [Name])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RecordPatSynField (Located Name) -&gt; (Name, Name))
-&gt; [RecordPatSynField (Located Name)] -&gt; [(Name, Name)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located Name) -&gt; (Name, Name)
</span><a href="#local-6989586621681095624"><span class="hs-identifier hs-var">splitRecordPatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681095627"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-572"></span><span>    </span><span class="annot"><a href="#local-6989586621681095624"><span class="hs-identifier hs-type">splitRecordPatSyn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#RecordPatSynField"><span class="hs-identifier hs-type">RecordPatSynField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-573"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span>    </span><span id="local-6989586621681095624"><span class="annot"><span class="annottext">splitRecordPatSyn :: RecordPatSynField (Located Name) -&gt; (Name, Name)
</span><a href="#local-6989586621681095624"><span class="hs-identifier hs-var hs-var">splitRecordPatSyn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#RecordPatSynField"><span class="hs-identifier hs-type">RecordPatSynField</span></a></span><span>
</span><span id="line-575"></span><span>                       </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recordPatSynPatVar :: forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynPatVar"><span class="hs-identifier hs-var">recordPatSynPatVar</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095621"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095621"><span class="hs-identifier hs-var">patVar</span></a></span></span><span>
</span><span id="line-576"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recordPatSynSelectorId :: forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynSelectorId"><span class="hs-identifier hs-var">recordPatSynSelectorId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095619"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095619"><span class="hs-identifier hs-var">selId</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095621"><span class="hs-identifier hs-var">patVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095619"><span class="hs-identifier hs-var">selId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>
</span><span id="line-579"></span><span id="local-6989586621681096381"><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#addPatSynCtxt"><span class="hs-identifier hs-type">addPatSynCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096381"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096381"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-580"></span><span id="addPatSynCtxt"><span class="annot"><span class="annottext">addPatSynCtxt :: forall a. Located Name -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#addPatSynCtxt"><span class="hs-identifier hs-var hs-var">addPatSynCtxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095617"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095617"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095616"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095616"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681095615"><span class="annot"><span class="annottext">TcM a
</span><a href="#local-6989586621681095615"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-581"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM a -&gt; TcM a
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095617"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM a -&gt; TcM a) -&gt; TcM a -&gt; TcM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-582"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM a -&gt; TcM a
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the declaration for pattern synonym&quot;</span></span><span>
</span><span id="line-583"></span><span>                </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095616"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM a -&gt; TcM a) -&gt; TcM a -&gt; TcM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-584"></span><span>    </span><span class="annot"><span class="annottext">TcM a
</span><a href="#local-6989586621681095615"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span id="local-6989586621681096339"><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#wrongNumberOfParmsErr"><span class="hs-identifier hs-type">wrongNumberOfParmsErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096339"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-587"></span><span id="wrongNumberOfParmsErr"><span class="annot"><span class="annottext">wrongNumberOfParmsErr :: forall a. Name -&gt; Int -&gt; Int -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#wrongNumberOfParmsErr"><span class="hs-identifier hs-var hs-var">wrongNumberOfParmsErr</span></a></span></span><span> </span><span id="local-6989586621681095610"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095610"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681095609"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095609"><span class="hs-identifier hs-var">decl_arity</span></a></span></span><span> </span><span id="local-6989586621681095608"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095608"><span class="hs-identifier hs-var">missing</span></a></span></span><span>
</span><span id="line-588"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM a
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcM a) -&gt; MsgDoc -&gt; TcM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-589"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern synonym&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095610"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;has&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-590"></span><span>          </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#speakNOf"><span class="hs-identifier hs-var">speakNOf</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095609"><span class="hs-identifier hs-var">decl_arity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;argument&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;but its type signature has&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095608"><span class="hs-identifier hs-var">missing</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fewer arrows&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">-------------------------</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- Shared by both tcInferPatSyn and tcCheckPatSyn</span><span>
</span><span id="line-595"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tc_patsyn_finish"><span class="hs-identifier hs-type">tc_patsyn_finish</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>      </span><span class="hs-comment">-- ^ PatSyn Name</span><span>
</span><span id="line-596"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsPatSynDir"><span class="hs-identifier hs-type">HsPatSynDir</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-comment">-- ^ PatSyn type (Uni/Bidir/ExplicitBidir)</span><span>
</span><span id="line-597"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>              </span><span class="hs-comment">-- ^ Whether infix</span><span>
</span><span id="line-598"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>        </span><span class="hs-comment">-- ^ Pattern of the PatSyn</span><span>
</span><span id="line-599"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcInvisTVBinder"><span class="hs-identifier hs-type">TcInvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-600"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcInvisTVBinder"><span class="hs-identifier hs-type">TcInvisTVBinder</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PredType"><span class="hs-identifier hs-type">PredType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-601"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ Pattern arguments and types</span><span>
</span><span id="line-602"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>            </span><span class="hs-comment">-- ^ Pattern type</span><span>
</span><span id="line-603"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>            </span><span class="hs-comment">-- ^ Selector names</span><span>
</span><span id="line-604"></span><span>                 </span><span class="hs-comment">-- ^ Whether fields, empty if not record PatSyn</span><span>
</span><span id="line-605"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcGblEnv"><span class="hs-identifier hs-type">TcGblEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span id="tc_patsyn_finish"><span class="annot"><span class="annottext">tc_patsyn_finish :: Located Name
-&gt; HsPatSynDir GhcRn
-&gt; Bool
-&gt; LPat GhcTc
-&gt; ([VarBndr Id Specificity], [Kind], TcEvBinds, [Id])
-&gt; ([VarBndr Id Specificity], [Kind], [Kind], [EvTerm])
-&gt; ([LHsExpr GhcTc], [Kind])
-&gt; Kind
-&gt; [Name]
-&gt; TcM (LHsBinds GhcTc, TcGblEnv)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tc_patsyn_finish"><span class="hs-identifier hs-var hs-var">tc_patsyn_finish</span></a></span></span><span> </span><span id="local-6989586621681095599"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095599"><span class="hs-identifier hs-var">lname</span></a></span></span><span> </span><span id="local-6989586621681095598"><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095598"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span id="local-6989586621681095597"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095597"><span class="hs-identifier hs-var">is_infix</span></a></span></span><span> </span><span id="local-6989586621681095596"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095596"><span class="hs-identifier hs-var">lpat'</span></a></span></span><span>
</span><span id="line-607"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681095595"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095595"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095594"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095594"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095593"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095593"><span class="hs-identifier hs-var">req_ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095592"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095592"><span class="hs-identifier hs-var">req_dicts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681095591"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095591"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span>   </span><span id="local-6989586621681095590"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095590"><span class="hs-identifier hs-var">ex_tys</span></a></span></span><span class="hs-special">,</span><span>    </span><span id="local-6989586621681095589"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095589"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span class="hs-special">,</span><span>   </span><span id="local-6989586621681095588"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095588"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-609"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681095587"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095587"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095586"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095586"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>                 </span><span id="local-6989586621681095585"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095585"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span> </span><span id="local-6989586621681095584"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095584"><span class="hs-identifier hs-var">field_labels</span></a></span></span><span>
</span><span id="line-611"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Zonk everything.  We are about to build a final PatSyn</span><span>
</span><span id="line-612"></span><span>         </span><span class="hs-comment">-- so there had better be no unification variables in there</span><span>
</span><span id="line-613"></span><span>
</span><span id="line-614"></span><span>         </span><span class="hs-special">(</span><span id="local-6989586621681095583"><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095583"><span class="hs-identifier hs-var">ze</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095582"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095582"><span class="hs-identifier hs-var">univ_tvs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; TcM (ZonkEnv, [VarBndr Id Specificity])
forall vis. [VarBndr Id vis] -&gt; TcM (ZonkEnv, [VarBndr Id vis])
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTyVarBinders"><span class="hs-identifier hs-var">zonkTyVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095595"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span>
</span><span id="line-615"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095580"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095580"><span class="hs-identifier hs-var">req_theta'</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkEnv -&gt; [Kind] -&gt; TcM [Kind]
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypesToTypesX"><span class="hs-identifier hs-var">zonkTcTypesToTypesX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095583"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095594"><span class="hs-identifier hs-var">req_theta</span></a></span><span>
</span><span id="line-616"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095578"><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095578"><span class="hs-identifier hs-var">ze</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095577"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095577"><span class="hs-identifier hs-var">ex_tvs'</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkEnv
-&gt; [VarBndr Id Specificity]
-&gt; TcM (ZonkEnv, [VarBndr Id Specificity])
forall vis.
ZonkEnv -&gt; [VarBndr Id vis] -&gt; TcM (ZonkEnv, [VarBndr Id vis])
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTyVarBindersX"><span class="hs-identifier hs-var">zonkTyVarBindersX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095583"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095591"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span>
</span><span id="line-617"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095575"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095575"><span class="hs-identifier hs-var">prov_theta'</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkEnv -&gt; [Kind] -&gt; TcM [Kind]
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypesToTypesX"><span class="hs-identifier hs-var">zonkTcTypesToTypesX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095578"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095589"><span class="hs-identifier hs-var">prov_theta</span></a></span><span>
</span><span id="line-618"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095574"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095574"><span class="hs-identifier hs-var">pat_ty'</span></a></span></span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkEnv -&gt; Kind -&gt; TcM Kind
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypeToTypeX"><span class="hs-identifier hs-var">zonkTcTypeToTypeX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095578"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095585"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-619"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095572"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095572"><span class="hs-identifier hs-var">arg_tys'</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ZonkEnv -&gt; [Kind] -&gt; TcM [Kind]
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypesToTypesX"><span class="hs-identifier hs-var">zonkTcTypesToTypesX</span></a></span><span> </span><span class="annot"><span class="annottext">ZonkEnv
</span><a href="#local-6989586621681095578"><span class="hs-identifier hs-var">ze</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095586"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-620"></span><span>
</span><span id="line-621"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095571"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095571"><span class="hs-identifier hs-var">env1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095570"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095570"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv
-&gt; [VarBndr Id Specificity] -&gt; (TidyEnv, [VarBndr Id Specificity])
forall vis.
TidyEnv -&gt; [VarBndr Id vis] -&gt; (TidyEnv, [VarBndr Id vis])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier hs-var">tidyTyCoVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="GHC.Types.Var.Env.html#emptyTidyEnv"><span class="hs-identifier hs-var">emptyTidyEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095582"><span class="hs-identifier hs-var">univ_tvs'</span></a></span><span>
</span><span id="line-622"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681095569"><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095569"><span class="hs-identifier hs-var">env2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095568"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095568"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv
-&gt; [VarBndr Id Specificity] -&gt; (TidyEnv, [VarBndr Id Specificity])
forall vis.
TidyEnv -&gt; [VarBndr Id vis] -&gt; (TidyEnv, [VarBndr Id vis])
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTyCoVarBinders"><span class="hs-identifier hs-var">tidyTyCoVarBinders</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095571"><span class="hs-identifier hs-var">env1</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095577"><span class="hs-identifier hs-var">ex_tvs'</span></a></span><span>
</span><span id="line-623"></span><span>             </span><span id="local-6989586621681095567"><span class="annot"><span class="annottext">req_theta :: [Kind]
</span><a href="#local-6989586621681095567"><span class="hs-identifier hs-var hs-var">req_theta</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Kind] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var">tidyTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095569"><span class="hs-identifier hs-var">env2</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095580"><span class="hs-identifier hs-var">req_theta'</span></a></span><span>
</span><span id="line-624"></span><span>             </span><span id="local-6989586621681095566"><span class="annot"><span class="annottext">prov_theta :: [Kind]
</span><a href="#local-6989586621681095566"><span class="hs-identifier hs-var hs-var">prov_theta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Kind] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var">tidyTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095569"><span class="hs-identifier hs-var">env2</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095575"><span class="hs-identifier hs-var">prov_theta'</span></a></span><span>
</span><span id="line-625"></span><span>             </span><span id="local-6989586621681095565"><span class="annot"><span class="annottext">arg_tys :: [Kind]
</span><a href="#local-6989586621681095565"><span class="hs-identifier hs-var hs-var">arg_tys</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; [Kind] -&gt; [Kind]
</span><a href="GHC.Core.TyCo.Tidy.html#tidyTypes"><span class="hs-identifier hs-var">tidyTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095569"><span class="hs-identifier hs-var">env2</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095572"><span class="hs-identifier hs-var">arg_tys'</span></a></span><span>
</span><span id="line-626"></span><span>             </span><span id="local-6989586621681095564"><span class="annot"><span class="annottext">pat_ty :: Kind
</span><a href="#local-6989586621681095564"><span class="hs-identifier hs-var hs-var">pat_ty</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TidyEnv -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Tidy.html#tidyType"><span class="hs-identifier hs-var">tidyType</span></a></span><span>  </span><span class="annot"><span class="annottext">TidyEnv
</span><a href="#local-6989586621681095569"><span class="hs-identifier hs-var">env2</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095574"><span class="hs-identifier hs-var">pat_ty'</span></a></span><span>
</span><span id="line-627"></span><span>
</span><span id="line-628"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tc_patsyn_finish {&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-629"></span><span>           </span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095599"><span class="hs-identifier hs-var">lname</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095596"><span class="hs-identifier hs-var">lpat'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-630"></span><span>           </span><span class="annot"><span class="annottext">([VarBndr Id Specificity], [Kind], TcEvBinds, [Id]) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095570"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095567"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095593"><span class="hs-identifier hs-var">req_ev_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095592"><span class="hs-identifier hs-var">req_dicts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-631"></span><span>           </span><span class="annot"><span class="annottext">([VarBndr Id Specificity], [Kind], [EvTerm]) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095568"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095566"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095588"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-632"></span><span>           </span><span class="annot"><span class="annottext">[LHsExpr GhcTc] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095587"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-633"></span><span>           </span><span class="annot"><span class="annottext">[Kind] -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095565"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-634"></span><span>           </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095564"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span>       </span><span class="hs-comment">-- Make the 'matcher'</span><span>
</span><span id="line-637"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095563"><span class="annot"><span class="annottext">(Id, Bool)
</span><a href="#local-6989586621681095563"><span class="hs-identifier hs-var">matcher_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095562"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095562"><span class="hs-identifier hs-var">matcher_bind</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; LPat GhcTc
-&gt; ([Id], [Kind], TcEvBinds, [Id])
-&gt; ([Id], [Kind], [Kind], [EvTerm])
-&gt; ([LHsExpr GhcTc], [Kind])
-&gt; Kind
-&gt; TcM ((Id, Bool), LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynMatcher"><span class="hs-identifier hs-var">tcPatSynMatcher</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095599"><span class="hs-identifier hs-var">lname</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095596"><span class="hs-identifier hs-var">lpat'</span></a></span><span>
</span><span id="line-638"></span><span>                                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095570"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095567"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095593"><span class="hs-identifier hs-var">req_ev_binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095592"><span class="hs-identifier hs-var">req_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-639"></span><span>                                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; [Id]
forall tv argf. [VarBndr tv argf] -&gt; [tv]
</span><a href="GHC.Types.Var.html#binderVars"><span class="hs-identifier hs-var">binderVars</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095568"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095590"><span class="hs-identifier hs-var">ex_tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095566"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095588"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-640"></span><span>                                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095587"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095565"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-641"></span><span>                                         </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095564"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span>       </span><span class="hs-comment">-- Make the 'builder'</span><span>
</span><span id="line-644"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095560"><span class="annot"><span class="annottext">Maybe (Id, Bool)
</span><a href="#local-6989586621681095560"><span class="hs-identifier hs-var">builder_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
-&gt; Located Name
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [Kind]
-&gt; Kind
-&gt; TcM (Maybe (Id, Bool))
forall a.
HsPatSynDir a
-&gt; Located Name
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [Kind]
-&gt; Kind
-&gt; TcM (Maybe (Id, Bool))
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynBuilderId"><span class="hs-identifier hs-var">mkPatSynBuilderId</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095598"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095599"><span class="hs-identifier hs-var">lname</span></a></span><span>
</span><span id="line-645"></span><span>                                         </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095570"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095567"><span class="hs-identifier hs-var">req_theta</span></a></span><span>
</span><span id="line-646"></span><span>                                         </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095568"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span>   </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095566"><span class="hs-identifier hs-var">prov_theta</span></a></span><span>
</span><span id="line-647"></span><span>                                         </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095565"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095564"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-648"></span><span>
</span><span id="line-649"></span><span>         </span><span class="hs-comment">-- TODO: Make this have the proper information</span><span>
</span><span id="line-650"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095558"><span class="annot"><span class="annottext">mkFieldLabel :: Name -&gt; FieldLabel
</span><a href="#local-6989586621681095558"><span class="hs-identifier hs-var hs-var">mkFieldLabel</span></a></span></span><span> </span><span id="local-6989586621681095557"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095557"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FieldLabel :: forall a. FieldLabelString -&gt; Bool -&gt; a -&gt; FieldLbl a
</span><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">flLabel :: FieldLabelString
</span><a href="GHC.Types.FieldLabel.html#flLabel"><span class="hs-identifier hs-var">flLabel</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; FieldLabelString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095557"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-651"></span><span>                                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">flIsOverloaded :: Bool
</span><a href="GHC.Types.FieldLabel.html#flIsOverloaded"><span class="hs-identifier hs-var">flIsOverloaded</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-652"></span><span>                                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">flSelector :: Name
</span><a href="GHC.Types.FieldLabel.html#flSelector"><span class="hs-identifier hs-var">flSelector</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095557"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-653"></span><span>             </span><span id="local-6989586621681095550"><span class="annot"><span class="annottext">field_labels' :: [FieldLabel]
</span><a href="#local-6989586621681095550"><span class="hs-identifier hs-var hs-var">field_labels'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; FieldLabel) -&gt; [Name] -&gt; [FieldLabel]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; FieldLabel
</span><a href="#local-6989586621681095558"><span class="hs-identifier hs-var">mkFieldLabel</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681095584"><span class="hs-identifier hs-var">field_labels</span></a></span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span>
</span><span id="line-656"></span><span>       </span><span class="hs-comment">-- Make the PatSyn itself</span><span>
</span><span id="line-657"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095549"><span class="annot"><span class="annottext">patSyn :: PatSyn
</span><a href="#local-6989586621681095549"><span class="hs-identifier hs-var hs-var">patSyn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
-&gt; Bool
-&gt; ([VarBndr Id Specificity], [Kind])
-&gt; ([VarBndr Id Specificity], [Kind])
-&gt; [Kind]
-&gt; Kind
-&gt; (Id, Bool)
-&gt; Maybe (Id, Bool)
-&gt; [FieldLabel]
-&gt; PatSyn
</span><a href="GHC.Core.PatSyn.html#mkPatSyn"><span class="hs-identifier hs-var">mkPatSyn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095599"><span class="hs-identifier hs-var">lname</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095597"><span class="hs-identifier hs-var">is_infix</span></a></span><span>
</span><span id="line-658"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095570"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095567"><span class="hs-identifier hs-var">req_theta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095568"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095566"><span class="hs-identifier hs-var">prov_theta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-660"></span><span>                        </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095565"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-661"></span><span>                        </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095564"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-662"></span><span>                        </span><span class="annot"><span class="annottext">(Id, Bool)
</span><a href="#local-6989586621681095563"><span class="hs-identifier hs-var">matcher_id</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool)
</span><a href="#local-6989586621681095560"><span class="hs-identifier hs-var">builder_id</span></a></span><span>
</span><span id="line-663"></span><span>                        </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681095550"><span class="hs-identifier hs-var">field_labels'</span></a></span><span>
</span><span id="line-664"></span><span>
</span><span id="line-665"></span><span>       </span><span class="hs-comment">-- Selectors</span><span>
</span><span id="line-666"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095548"><span class="annot"><span class="annottext">rn_rec_sel_binds :: [(Id, LHsBind GhcRn)]
</span><a href="#local-6989586621681095548"><span class="hs-identifier hs-var hs-var">rn_rec_sel_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; [FieldLabel] -&gt; [(Id, LHsBind GhcRn)]
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynRecSelBinds"><span class="hs-identifier hs-var">mkPatSynRecSelBinds</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095549"><span class="hs-identifier hs-var">patSyn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; [FieldLabel]
</span><a href="GHC.Core.PatSyn.html#patSynFieldLabels"><span class="hs-identifier hs-var">patSynFieldLabels</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095549"><span class="hs-identifier hs-var">patSyn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-667"></span><span>             </span><span id="local-6989586621681095545"><span class="annot"><span class="annottext">tything :: TyThing
</span><a href="#local-6989586621681095545"><span class="hs-identifier hs-var hs-var">tything</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; TyThing
</span><a href="GHC.Core.TyCo.Rep.html#AConLike"><span class="hs-identifier hs-var">AConLike</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-var">PatSynCon</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095549"><span class="hs-identifier hs-var">patSyn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-668"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095544"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681095544"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TyThing] -&gt; TcM TcGblEnv -&gt; TcM TcGblEnv
forall r. [TyThing] -&gt; TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Env.html#tcExtendGlobalEnv"><span class="hs-identifier hs-var">tcExtendGlobalEnv</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TyThing
</span><a href="#local-6989586621681095545"><span class="hs-identifier hs-var">tything</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(TcM TcGblEnv -&gt; TcM TcGblEnv) -&gt; TcM TcGblEnv -&gt; TcM TcGblEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-669"></span><span>                    </span><span class="annot"><span class="annottext">[(Id, LHsBind GhcRn)] -&gt; TcM TcGblEnv
</span><a href="GHC.Tc.TyCl.Utils.html#tcRecSelBinds"><span class="hs-identifier hs-var">tcRecSelBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, LHsBind GhcRn)]
</span><a href="#local-6989586621681095548"><span class="hs-identifier hs-var">rn_rec_sel_binds</span></a></span><span>
</span><span id="line-670"></span><span>
</span><span id="line-671"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tc_patsyn_finish }&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-672"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsBinds GhcTc, TcGblEnv) -&gt; TcM (LHsBinds GhcTc, TcGblEnv)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095562"><span class="hs-identifier hs-var">matcher_bind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681095544"><span class="hs-identifier hs-var">tcg_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-673"></span><span>
</span><span id="line-674"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
         Constructing the &quot;matcher&quot; Id and its binding
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-681"></span><span>
</span><span id="line-682"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynMatcher"><span class="hs-identifier hs-type">tcPatSynMatcher</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-683"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-684"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-685"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TcTyVar"><span class="hs-identifier hs-type">TcTyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-686"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-687"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>
</span><span id="line-688"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-689"></span><span class="hs-comment">-- See Note [Matchers and builders for pattern synonyms] in GHC.Core.PatSyn</span><span>
</span><span id="line-690"></span><span id="tcPatSynMatcher"><span class="annot"><span class="annottext">tcPatSynMatcher :: Located Name
-&gt; LPat GhcTc
-&gt; ([Id], [Kind], TcEvBinds, [Id])
-&gt; ([Id], [Kind], [Kind], [EvTerm])
-&gt; ([LHsExpr GhcTc], [Kind])
-&gt; Kind
-&gt; TcM ((Id, Bool), LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynMatcher"><span class="hs-identifier hs-var hs-var">tcPatSynMatcher</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095539"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095539"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095538"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095538"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681095537"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span></span><span>
</span><span id="line-691"></span><span>                </span><span class="hs-special">(</span><span id="local-6989586621681095536"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095536"><span class="hs-identifier hs-var">univ_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095535"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095535"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095534"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095534"><span class="hs-identifier hs-var">req_ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095533"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095533"><span class="hs-identifier hs-var">req_dicts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-692"></span><span>                </span><span class="hs-special">(</span><span id="local-6989586621681095532"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095532"><span class="hs-identifier hs-var">ex_tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095531"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095531"><span class="hs-identifier hs-var">ex_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095530"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095530"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095529"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095529"><span class="hs-identifier hs-var">prov_dicts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>                </span><span class="hs-special">(</span><span id="local-6989586621681095528"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095528"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095527"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095527"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681095526"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span>
</span><span id="line-694"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095525"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095525"><span class="hs-identifier hs-var">rr_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SrcSpan -&gt; TcRnIf TcGblEnv TcLclEnv Name
</span><a href="GHC.Tc.Utils.Monad.html#newNameAt"><span class="hs-identifier hs-var">newNameAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyVarOcc"><span class="hs-identifier hs-var">mkTyVarOcc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rep&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095539"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-695"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095522"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095522"><span class="hs-identifier hs-var">tv_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SrcSpan -&gt; TcRnIf TcGblEnv TcLclEnv Name
</span><a href="GHC.Tc.Utils.Monad.html#newNameAt"><span class="hs-identifier hs-var">newNameAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkTyVarOcc"><span class="hs-identifier hs-var">mkTyVarOcc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;r&quot;</span></span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095539"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-696"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095521"><span class="annot"><span class="annottext">rr_tv :: Id
</span><a href="#local-6989586621681095521"><span class="hs-identifier hs-var hs-var">rr_tv</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Var.html#mkTyVar"><span class="hs-identifier hs-var">mkTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095525"><span class="hs-identifier hs-var">rr_name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.html#runtimeRepTy"><span class="hs-identifier hs-var">runtimeRepTy</span></a></span><span>
</span><span id="line-697"></span><span>             </span><span id="local-6989586621681095518"><span class="annot"><span class="annottext">rr :: Kind
</span><a href="#local-6989586621681095518"><span class="hs-identifier hs-var hs-var">rr</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095521"><span class="hs-identifier hs-var">rr_tv</span></a></span><span>
</span><span id="line-698"></span><span>             </span><span id="local-6989586621681095516"><span class="annot"><span class="annottext">res_tv :: Id
</span><a href="#local-6989586621681095516"><span class="hs-identifier hs-var hs-var">res_tv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Var.html#mkTyVar"><span class="hs-identifier hs-var">mkTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095522"><span class="hs-identifier hs-var">tv_name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Kind -&gt; Kind
</span><a href="GHC.Builtin.Types.Prim.html#tYPE"><span class="hs-identifier hs-var">tYPE</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095518"><span class="hs-identifier hs-var">rr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span>             </span><span id="local-6989586621681095514"><span class="annot"><span class="annottext">res_ty :: Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095516"><span class="hs-identifier hs-var">res_tv</span></a></span><span>
</span><span id="line-700"></span><span>             </span><span id="local-6989586621681095513"><span class="annot"><span class="annottext">is_unlifted :: Bool
</span><a href="#local-6989586621681095513"><span class="hs-identifier hs-var hs-var">is_unlifted</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095528"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[EvTerm] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095529"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span>
</span><span id="line-701"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681095512"><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095512"><span class="hs-identifier hs-var">cont_args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095511"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095511"><span class="hs-identifier hs-var">cont_arg_tys</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-702"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095513"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">IdP GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="GHC.Types.Id.Make.html#voidPrimId"><span class="hs-identifier hs-var">voidPrimId</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.Prim.html#voidPrimTy"><span class="hs-identifier hs-var">voidPrimTy</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-703"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095528"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">,</span><span>                 </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095527"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-704"></span><span>             </span><span id="local-6989586621681095508"><span class="annot"><span class="annottext">cont_ty :: Kind
</span><a href="#local-6989586621681095508"><span class="hs-identifier hs-var hs-var">cont_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkInfSigmaTy"><span class="hs-identifier hs-var">mkInfSigmaTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095532"><span class="hs-identifier hs-var">ex_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095530"><span class="hs-identifier hs-var">prov_theta</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-705"></span><span>                       </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095511"><span class="hs-identifier hs-var">cont_arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-706"></span><span>
</span><span id="line-707"></span><span>             </span><span id="local-6989586621681095505"><span class="annot"><span class="annottext">fail_ty :: Kind
</span><a href="#local-6989586621681095505"><span class="hs-identifier hs-var hs-var">fail_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.Prim.html#voidPrimTy"><span class="hs-identifier hs-var">voidPrimTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-708"></span><span>
</span><span id="line-709"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095503"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095503"><span class="hs-identifier hs-var">matcher_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf TcGblEnv TcLclEnv Name
forall m n. Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf m n Name
</span><a href="GHC.Tc.TyCl.Build.html#newImplicitBinder"><span class="hs-identifier hs-var">newImplicitBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095538"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkMatcherOcc"><span class="hs-identifier hs-var">mkMatcherOcc</span></a></span><span>
</span><span id="line-710"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095502"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095502"><span class="hs-identifier hs-var">scrutinee</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FieldLabelString
-&gt; Kind -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
forall gbl lcl.
FieldLabelString -&gt; Kind -&gt; Kind -&gt; TcRnIf gbl lcl Id
</span><a href="GHC.Tc.Utils.Monad.html#newSysLocalId"><span class="hs-identifier hs-var">newSysLocalId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FieldLabelString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;scrut&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-711"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095499"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095499"><span class="hs-identifier hs-var">cont</span></a></span></span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FieldLabelString
-&gt; Kind -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
forall gbl lcl.
FieldLabelString -&gt; Kind -&gt; Kind -&gt; TcRnIf gbl lcl Id
</span><a href="GHC.Tc.Utils.Monad.html#newSysLocalId"><span class="hs-identifier hs-var">newSysLocalId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FieldLabelString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cont&quot;</span></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095508"><span class="hs-identifier hs-var">cont_ty</span></a></span><span>
</span><span id="line-712"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095498"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095498"><span class="hs-identifier hs-var">fail</span></a></span></span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FieldLabelString
-&gt; Kind -&gt; Kind -&gt; IOEnv (Env TcGblEnv TcLclEnv) Id
forall gbl lcl.
FieldLabelString -&gt; Kind -&gt; Kind -&gt; TcRnIf gbl lcl Id
</span><a href="GHC.Tc.Utils.Monad.html#newSysLocalId"><span class="hs-identifier hs-var">newSysLocalId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FieldLabelString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fail&quot;</span></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095505"><span class="hs-identifier hs-var">fail_ty</span></a></span><span>
</span><span id="line-713"></span><span>
</span><span id="line-714"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681095497"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681095497"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-715"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095496"><span class="annot"><span class="annottext">matcher_tau :: Kind
</span><a href="#local-6989586621681095496"><span class="hs-identifier hs-var hs-var">matcher_tau</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095508"><span class="hs-identifier hs-var">cont_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095505"><span class="hs-identifier hs-var">fail_ty</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-716"></span><span>             </span><span id="local-6989586621681095495"><span class="annot"><span class="annottext">matcher_sigma :: Kind
</span><a href="#local-6989586621681095495"><span class="hs-identifier hs-var hs-var">matcher_sigma</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkInfSigmaTy"><span class="hs-identifier hs-var">mkInfSigmaTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095521"><span class="hs-identifier hs-var">rr_tv</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095516"><span class="hs-identifier hs-var">res_tv</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095536"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095535"><span class="hs-identifier hs-var">req_theta</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095496"><span class="hs-identifier hs-var">matcher_tau</span></a></span><span>
</span><span id="line-717"></span><span>             </span><span id="local-6989586621681095494"><span class="annot"><span class="annottext">matcher_id :: Id
</span><a href="#local-6989586621681095494"><span class="hs-identifier hs-var hs-var">matcher_id</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkExportedVanillaId"><span class="hs-identifier hs-var">mkExportedVanillaId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095503"><span class="hs-identifier hs-var">matcher_name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095495"><span class="hs-identifier hs-var">matcher_sigma</span></a></span><span>
</span><span id="line-718"></span><span>                             </span><span class="hs-comment">-- See Note [Exported LocalIds] in GHC.Types.Id</span><span>
</span><span id="line-719"></span><span>
</span><span id="line-720"></span><span>             </span><span id="local-6989586621681095492"><span class="annot"><span class="annottext">inst_wrap :: HsWrapper
</span><a href="#local-6989586621681095492"><span class="hs-identifier hs-var hs-var">inst_wrap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvTerm] -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpEvApps"><span class="hs-identifier hs-var">mkWpEvApps</span></a></span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681095529"><span class="hs-identifier hs-var">prov_dicts</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; HsWrapper -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpTyApps"><span class="hs-identifier hs-var">mkWpTyApps</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095531"><span class="hs-identifier hs-var">ex_tys</span></a></span><span>
</span><span id="line-721"></span><span>             </span><span id="local-6989586621681095488"><span class="annot"><span class="annottext">cont' :: LHsExpr GhcTc
</span><a href="#local-6989586621681095488"><span class="hs-identifier hs-var hs-var">cont'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc)
-&gt; LHsExpr GhcTc -&gt; [LHsExpr GhcTc] -&gt; LHsExpr GhcTc
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass).
IsPass id =&gt;
LHsExpr (GhcPass id)
-&gt; LHsExpr (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsApp"><span class="hs-identifier hs-var">nlHsApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkLHsWrap"><span class="hs-identifier hs-var">mkLHsWrap</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681095492"><span class="hs-identifier hs-var">inst_wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681095499"><span class="hs-identifier hs-var">cont</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcTc]
</span><a href="#local-6989586621681095512"><span class="hs-identifier hs-var">cont_args</span></a></span><span>
</span><span id="line-722"></span><span>
</span><span id="line-723"></span><span>             </span><span id="local-6989586621681095485"><span class="annot"><span class="annottext">fail' :: LHsExpr GhcTc
</span><a href="#local-6989586621681095485"><span class="hs-identifier hs-var hs-var">fail'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdP GhcTc -&gt; [LHsExpr GhcTc] -&gt; LHsExpr GhcTc
forall (id :: Pass).
IsPass id =&gt;
IdP (GhcPass id) -&gt; [LHsExpr (GhcPass id)] -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsApps"><span class="hs-identifier hs-var">nlHsApps</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681095498"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">IdP GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="GHC.Types.Id.Make.html#voidPrimId"><span class="hs-identifier hs-var">voidPrimId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-724"></span><span>
</span><span id="line-725"></span><span>             </span><span id="local-6989586621681095483"><span class="annot"><span class="annottext">args :: [Located (Pat GhcTc)]
</span><a href="#local-6989586621681095483"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Located (Pat GhcTc)) -&gt; [Id] -&gt; [Located (Pat GhcTc)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Located (Pat GhcTc)
forall (id :: Pass). IdP (GhcPass id) -&gt; LPat (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlVarPat"><span class="hs-identifier hs-var">nlVarPat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095502"><span class="hs-identifier hs-var">scrutinee</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095499"><span class="hs-identifier hs-var">cont</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095498"><span class="hs-identifier hs-var">fail</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-726"></span><span>             </span><span id="local-6989586621681095481"><span class="annot"><span class="annottext">lwpat :: Located (Pat GhcTc)
</span><a href="#local-6989586621681095481"><span class="hs-identifier hs-var hs-var">lwpat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; Located (Pat GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; Located (Pat GhcTc))
-&gt; Pat GhcTc -&gt; Located (Pat GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XWildPat GhcTc -&gt; Pat GhcTc
forall p. XWildPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-var">WildPat</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
XWildPat GhcTc
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-727"></span><span>             </span><span id="local-6989586621681095478"><span class="annot"><span class="annottext">cases :: [LMatch GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681095478"><span class="hs-identifier hs-var hs-var">cases</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LPat GhcTc -&gt; Bool
forall (p :: Pass).
OutputableBndrId p =&gt;
DynFlags -&gt; LPat (GhcPass p) -&gt; Bool
</span><a href="GHC.Hs.Pat.html#isIrrefutableHsPat"><span class="hs-identifier hs-var">isIrrefutableHsPat</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681095497"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span><span>
</span><span id="line-728"></span><span>                     </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsExpr GhcTc -&gt; LMatch GhcTc (LHsExpr GhcTc)
forall (p :: Pass) (body :: * -&gt; *).
LPat (GhcPass p)
-&gt; Located (body (GhcPass p))
-&gt; LMatch (GhcPass p) (Located (body (GhcPass p)))
</span><a href="GHC.Hs.Utils.html#mkHsCaseAlt"><span class="hs-identifier hs-var">mkHsCaseAlt</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span><span>  </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681095488"><span class="hs-identifier hs-var">cont'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-729"></span><span>                     </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsExpr GhcTc -&gt; LMatch GhcTc (LHsExpr GhcTc)
forall (p :: Pass) (body :: * -&gt; *).
LPat (GhcPass p)
-&gt; Located (body (GhcPass p))
-&gt; LMatch (GhcPass p) (Located (body (GhcPass p)))
</span><a href="GHC.Hs.Utils.html#mkHsCaseAlt"><span class="hs-identifier hs-var">mkHsCaseAlt</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span><span>  </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681095488"><span class="hs-identifier hs-var">cont'</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-730"></span><span>                           </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsExpr GhcTc -&gt; LMatch GhcTc (LHsExpr GhcTc)
forall (p :: Pass) (body :: * -&gt; *).
LPat (GhcPass p)
-&gt; Located (body (GhcPass p))
-&gt; LMatch (GhcPass p) (Located (body (GhcPass p)))
</span><a href="GHC.Hs.Utils.html#mkHsCaseAlt"><span class="hs-identifier hs-var">mkHsCaseAlt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095481"><span class="hs-identifier hs-var">lwpat</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681095485"><span class="hs-identifier hs-var">fail'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-731"></span><span>             </span><span id="local-6989586621681095475"><span class="annot"><span class="annottext">body :: LHsExpr GhcTc
</span><a href="#local-6989586621681095475"><span class="hs-identifier hs-var hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkLHsWrap"><span class="hs-identifier hs-var">mkLHsWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcEvBinds -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpLet"><span class="hs-identifier hs-var">mkWpLet</span></a></span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681095534"><span class="hs-identifier hs-var">req_ev_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; LHsExpr GhcTc) -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-732"></span><span>                    </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr GhcTc -&gt; LHsExpr GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc -&gt; LHsExpr GhcTc) -&gt; HsExpr GhcTc -&gt; LHsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-733"></span><span>                    </span><span class="annot"><span class="annottext">XCase GhcTc
-&gt; LHsExpr GhcTc
-&gt; MatchGroup GhcTc (LHsExpr GhcTc)
-&gt; HsExpr GhcTc
forall p.
XCase p -&gt; LHsExpr p -&gt; MatchGroup p (LHsExpr p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsCase"><span class="hs-identifier hs-var">HsCase</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCase GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP GhcTc -&gt; LHsExpr GhcTc
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Id
IdP GhcTc
</span><a href="#local-6989586621681095502"><span class="hs-identifier hs-var">scrutinee</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(MatchGroup GhcTc (LHsExpr GhcTc) -&gt; HsExpr GhcTc)
-&gt; MatchGroup GhcTc (LHsExpr GhcTc) -&gt; HsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-734"></span><span>                    </span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [LMatch GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch GhcTc (LHsExpr GhcTc)]
-&gt; Located [LMatch GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681095537"><span class="hs-identifier hs-var">lpat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681095478"><span class="hs-identifier hs-var">cases</span></a></span><span>
</span><span id="line-735"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Kind] -&gt; Kind -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind -&gt; Scaled Kind
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-736"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#Generated"><span class="hs-identifier hs-var">Generated</span></a></span><span>
</span><span id="line-737"></span><span>                      </span><span class="hs-special">}</span><span>
</span><span id="line-738"></span><span>             </span><span id="local-6989586621681095464"><span class="annot"><span class="annottext">body' :: LHsExpr GhcTc
</span><a href="#local-6989586621681095464"><span class="hs-identifier hs-var hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; LHsExpr GhcTc
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc -&gt; LHsExpr GhcTc) -&gt; HsExpr GhcTc -&gt; LHsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-739"></span><span>                     </span><span class="annot"><span class="annottext">XLam GhcTc -&gt; MatchGroup GhcTc (LHsExpr GhcTc) -&gt; HsExpr GhcTc
forall p. XLam p -&gt; MatchGroup p (LHsExpr p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsLam"><span class="hs-identifier hs-var">HsLam</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLam GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(MatchGroup GhcTc (LHsExpr GhcTc) -&gt; HsExpr GhcTc)
-&gt; MatchGroup GhcTc (LHsExpr GhcTc) -&gt; HsExpr GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-740"></span><span>                     </span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [LMatch GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcTc (LHsExpr GhcTc)]
-&gt; Located [LMatch GhcTc (LHsExpr GhcTc)]
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcTc)
-&gt; [LPat GhcTc] -&gt; LHsExpr GhcTc -&gt; LMatch GhcTc (LHsExpr GhcTc)
forall (p :: Pass) (body :: * -&gt; *).
HsMatchContext (NoGhcTc (GhcPass p))
-&gt; [LPat (GhcPass p)]
-&gt; Located (body (GhcPass p))
-&gt; LMatch (GhcPass p) (Located (body (GhcPass p)))
</span><a href="GHC.Hs.Utils.html#mkSimpleMatch"><span class="hs-identifier hs-var">mkSimpleMatch</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcTc)
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span>
</span><span id="line-741"></span><span>                                                        </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681095483"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681095475"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-742"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Kind] -&gt; Kind -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Kind -&gt; Scaled Kind) -&gt; [Kind] -&gt; [Scaled Kind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Scaled Kind
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095526"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095508"><span class="hs-identifier hs-var">cont_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095505"><span class="hs-identifier hs-var">fail_ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-743"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#Generated"><span class="hs-identifier hs-var">Generated</span></a></span><span>
</span><span id="line-744"></span><span>                       </span><span class="hs-special">}</span><span>
</span><span id="line-745"></span><span>             </span><span id="local-6989586621681095460"><span class="annot"><span class="annottext">match :: LMatch GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681095460"><span class="hs-identifier hs-var hs-var">match</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcTc)
-&gt; [LPat GhcTc]
-&gt; LHsExpr GhcTc
-&gt; Located (HsLocalBinds GhcTc)
-&gt; LMatch GhcTc (LHsExpr GhcTc)
forall (p :: Pass).
IsPass p =&gt;
HsMatchContext (NoGhcTc (GhcPass p))
-&gt; [LPat (GhcPass p)]
-&gt; LHsExpr (GhcPass p)
-&gt; Located (HsLocalBinds (GhcPass p))
-&gt; LMatch (GhcPass p) (LHsExpr (GhcPass p))
</span><a href="GHC.Hs.Utils.html#mkMatch"><span class="hs-identifier hs-var">mkMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn) -&gt; HsMatchContext GhcRn
forall p. LIdP p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Utils.html#mkPrefixFunRhs"><span class="hs-identifier hs-var">mkPrefixFunRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095539"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095538"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-746"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsLams"><span class="hs-identifier hs-var">mkHsLams</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095521"><span class="hs-identifier hs-var">rr_tv</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095516"><span class="hs-identifier hs-var">res_tv</span></a></span><span class="annot"><span class="annottext">Id -&gt; [Id] -&gt; [Id]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095536"><span class="hs-identifier hs-var">univ_tvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>                                       </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681095533"><span class="hs-identifier hs-var">req_dicts</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681095464"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsLocalBinds GhcTc -&gt; Located (HsLocalBinds GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XEmptyLocalBinds GhcTc GhcTc -&gt; HsLocalBinds GhcTc
forall idL idR. XEmptyLocalBinds idL idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#EmptyLocalBinds"><span class="hs-identifier hs-var">EmptyLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XEmptyLocalBinds GhcTc GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-749"></span><span>             </span><span class="annot"><a href="#local-6989586621681095455"><span class="hs-identifier hs-type">mg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span>             </span><span id="local-6989586621681095455"><span class="annot"><span class="annottext">mg :: MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681095455"><span class="hs-identifier hs-var hs-var">mg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [LMatch GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch GhcTc (LHsExpr GhcTc)]
-&gt; Located [LMatch GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LMatch GhcTc (LHsExpr GhcTc) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LMatch GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681095460"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LMatch GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681095460"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-751"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Kind] -&gt; Kind -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095514"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-752"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#Generated"><span class="hs-identifier hs-var">Generated</span></a></span><span>
</span><span id="line-753"></span><span>                    </span><span class="hs-special">}</span><span>
</span><span id="line-754"></span><span>
</span><span id="line-755"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095454"><span class="annot"><span class="annottext">bind :: HsBindLR GhcTc GhcTc
</span><a href="#local-6989586621681095454"><span class="hs-identifier hs-var hs-var">bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FunBind :: forall idL idR.
XFunBind idL idR
-&gt; Located (IdP idL)
-&gt; MatchGroup idR (LHsExpr idR)
-&gt; [Tickish Id]
-&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: Located (IdP GhcTc)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Id -&gt; Located Id
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095539"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095494"><span class="hs-identifier hs-var">matcher_id</span></a></span><span>
</span><span id="line-756"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_matches :: MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681095455"><span class="hs-identifier hs-var">mg</span></a></span><span>
</span><span id="line-757"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: XFunBind GhcTc GhcTc
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XFunBind GhcTc GhcTc
HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#idHsWrapper"><span class="hs-identifier hs-var">idHsWrapper</span></a></span><span>
</span><span id="line-758"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_tick :: [Tickish Id]
</span><a href="GHC.Hs.Binds.html#fun_tick"><span class="hs-identifier hs-var">fun_tick</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-759"></span><span>             </span><span id="local-6989586621681095447"><span class="annot"><span class="annottext">matcher_bind :: LHsBinds GhcTc
</span><a href="#local-6989586621681095447"><span class="hs-identifier hs-var hs-var">matcher_bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR GhcTc GhcTc) -&gt; LHsBinds GhcTc
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcTc GhcTc -&gt; GenLocated SrcSpan (HsBindLR GhcTc GhcTc)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcTc GhcTc
</span><a href="#local-6989586621681095454"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-760"></span><span>
</span><span id="line-761"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynMatcher&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095538"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095494"><span class="hs-identifier hs-var">matcher_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-762"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynMatcher&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095447"><span class="hs-identifier hs-var">matcher_bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-763"></span><span>
</span><span id="line-764"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((Id, Bool), LHsBinds GhcTc) -&gt; TcM ((Id, Bool), LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095494"><span class="hs-identifier hs-var">matcher_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095513"><span class="hs-identifier hs-var">is_unlifted</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095447"><span class="hs-identifier hs-var">matcher_bind</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-765"></span><span>
</span><span id="line-766"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynRecSelBinds"><span class="hs-identifier hs-type">mkPatSynRecSelBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span>
</span><span id="line-767"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.FieldLabel.html#FieldLabel"><span class="hs-identifier hs-type">FieldLabel</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- ^ Visible field labels</span><span>
</span><span id="line-768"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-769"></span><span id="mkPatSynRecSelBinds"><span class="annot"><span class="annottext">mkPatSynRecSelBinds :: PatSyn -&gt; [FieldLabel] -&gt; [(Id, LHsBind GhcRn)]
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynRecSelBinds"><span class="hs-identifier hs-var hs-var">mkPatSynRecSelBinds</span></a></span></span><span> </span><span id="local-6989586621681095445"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095445"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span id="local-6989586621681095444"><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681095444"><span class="hs-identifier hs-var">fields</span></a></span></span><span>
</span><span id="line-770"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[ConLike] -&gt; RecSelParent -&gt; FieldLabel -&gt; (Id, LHsBind GhcRn)
</span><a href="GHC.Tc.TyCl.Utils.html#mkOneRecordSelector"><span class="hs-identifier hs-var">mkOneRecordSelector</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">PatSyn -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-var">PatSynCon</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095445"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; RecSelParent
</span><a href="GHC.Types.Id.Info.html#RecSelPatSyn"><span class="hs-identifier hs-var">RecSelPatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095445"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621681095441"><span class="hs-identifier hs-var">fld_lbl</span></a></span><span>
</span><span id="line-771"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681095441"><span class="annot"><span class="annottext">FieldLabel
</span><a href="#local-6989586621681095441"><span class="hs-identifier hs-var">fld_lbl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[FieldLabel]
</span><a href="#local-6989586621681095444"><span class="hs-identifier hs-var">fields</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span id="local-6989586621681096239"><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-type">isUnidirectional</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsPatSynDir"><span class="hs-identifier hs-type">HsPatSynDir</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096239"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-774"></span><span id="isUnidirectional"><span class="annot"><span class="annottext">isUnidirectional :: forall a. HsPatSynDir a -&gt; Bool
</span><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-var hs-var">isUnidirectional</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir a
</span><a href="GHC.Hs.Binds.html#Unidirectional"><span class="hs-identifier hs-var">Unidirectional</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-775"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-var">isUnidirectional</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir a
</span><a href="GHC.Hs.Binds.html#ImplicitBidirectional"><span class="hs-identifier hs-var">ImplicitBidirectional</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-776"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-var">isUnidirectional</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#ExplicitBidirectional"><span class="hs-identifier hs-type">ExplicitBidirectional</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
         Constructing the &quot;builder&quot; Id
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span id="local-6989586621681096289"><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynBuilderId"><span class="hs-identifier hs-type">mkPatSynBuilderId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsPatSynDir"><span class="hs-identifier hs-type">HsPatSynDir</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096289"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-787"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span>
</span><span id="line-788"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#InvisTVBinder"><span class="hs-identifier hs-type">InvisTVBinder</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ThetaType"><span class="hs-identifier hs-type">ThetaType</span></a></span><span>
</span><span id="line-789"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-790"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-791"></span><span id="mkPatSynBuilderId"><span class="annot"><span class="annottext">mkPatSynBuilderId :: forall a.
HsPatSynDir a
-&gt; Located Name
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [VarBndr Id Specificity]
-&gt; [Kind]
-&gt; [Kind]
-&gt; Kind
-&gt; TcM (Maybe (Id, Bool))
</span><a href="GHC.Tc.TyCl.PatSyn.html#mkPatSynBuilderId"><span class="hs-identifier hs-var hs-var">mkPatSynBuilderId</span></a></span></span><span> </span><span id="local-6989586621681095428"><span class="annot"><span class="annottext">HsPatSynDir a
</span><a href="#local-6989586621681095428"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095427"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095427"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-792"></span><span>                  </span><span id="local-6989586621681095426"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095426"><span class="hs-identifier hs-var">univ_bndrs</span></a></span></span><span> </span><span id="local-6989586621681095425"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095425"><span class="hs-identifier hs-var">req_theta</span></a></span></span><span> </span><span id="local-6989586621681095424"><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095424"><span class="hs-identifier hs-var">ex_bndrs</span></a></span></span><span> </span><span id="local-6989586621681095423"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095423"><span class="hs-identifier hs-var">prov_theta</span></a></span></span><span>
</span><span id="line-793"></span><span>                  </span><span id="local-6989586621681095422"><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095422"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span> </span><span id="local-6989586621681095421"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095421"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span>
</span><span id="line-794"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir a -&gt; Bool
forall a. HsPatSynDir a -&gt; Bool
</span><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-var">isUnidirectional</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir a
</span><a href="#local-6989586621681095428"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-795"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool) -&gt; TcM (Maybe (Id, Bool))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-796"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-797"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095420"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095420"><span class="hs-identifier hs-var">builder_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf TcGblEnv TcLclEnv Name
forall m n. Name -&gt; (OccName -&gt; OccName) -&gt; TcRnIf m n Name
</span><a href="GHC.Tc.TyCl.Build.html#newImplicitBinder"><span class="hs-identifier hs-var">newImplicitBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095427"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkBuilderOcc"><span class="hs-identifier hs-var">mkBuilderOcc</span></a></span><span>
</span><span id="line-798"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095418"><span class="annot"><span class="annottext">theta :: [Kind]
</span><a href="#local-6989586621681095418"><span class="hs-identifier hs-var hs-var">theta</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095425"><span class="hs-identifier hs-var">req_theta</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; [Kind] -&gt; [Kind]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095423"><span class="hs-identifier hs-var">prov_theta</span></a></span><span>
</span><span id="line-799"></span><span>             </span><span id="local-6989586621681095417"><span class="annot"><span class="annottext">need_dummy_arg :: Bool
</span><a href="#local-6989586621681095417"><span class="hs-identifier hs-var hs-var">need_dummy_arg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Kind -&gt; Bool
Kind -&gt; Bool
</span><a href="GHC.Core.Type.html#isUnliftedType"><span class="hs-identifier hs-var">isUnliftedType</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095421"><span class="hs-identifier hs-var">pat_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095422"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Kind] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095418"><span class="hs-identifier hs-var">theta</span></a></span><span>
</span><span id="line-800"></span><span>             </span><span id="local-6989586621681095415"><span class="annot"><span class="annottext">builder_sigma :: Kind
</span><a href="#local-6989586621681095415"><span class="hs-identifier hs-var hs-var">builder_sigma</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.TyCl.PatSyn.html#add_void"><span class="hs-identifier hs-var">add_void</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095417"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-801"></span><span>                              </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisForAllTys"><span class="hs-identifier hs-var">mkInvisForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095426"><span class="hs-identifier hs-var">univ_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-802"></span><span>                              </span><span class="annot"><span class="annottext">[VarBndr Id Specificity] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkInvisForAllTys"><span class="hs-identifier hs-var">mkInvisForAllTys</span></a></span><span> </span><span class="annot"><span class="annottext">[VarBndr Id Specificity]
</span><a href="#local-6989586621681095424"><span class="hs-identifier hs-var">ex_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-803"></span><span>                              </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#mkPhiTy"><span class="hs-identifier hs-var">mkPhiTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095418"><span class="hs-identifier hs-var">theta</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-804"></span><span>                              </span><span class="annot"><span class="annottext">[Kind] -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Kind]
</span><a href="#local-6989586621681095422"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">(Kind -&gt; Kind) -&gt; Kind -&gt; Kind
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-805"></span><span>                              </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095421"><span class="hs-identifier hs-var">pat_ty</span></a></span><span>
</span><span id="line-806"></span><span>             </span><span id="local-6989586621681095411"><span class="annot"><span class="annottext">builder_id :: Id
</span><a href="#local-6989586621681095411"><span class="hs-identifier hs-var hs-var">builder_id</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Kind -&gt; Id
</span><a href="GHC.Types.Id.html#mkExportedVanillaId"><span class="hs-identifier hs-var">mkExportedVanillaId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095420"><span class="hs-identifier hs-var">builder_name</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095415"><span class="hs-identifier hs-var">builder_sigma</span></a></span><span>
</span><span id="line-807"></span><span>              </span><span class="hs-comment">-- See Note [Exported LocalIds] in GHC.Types.Id</span><span>
</span><span id="line-808"></span><span>
</span><span id="line-809"></span><span>             </span><span id="local-6989586621681095410"><span class="annot"><span class="annottext">builder_id' :: Id
</span><a href="#local-6989586621681095410"><span class="hs-identifier hs-var hs-var">builder_id'</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; (IdInfo -&gt; IdInfo) -&gt; Id -&gt; Id
(IdInfo -&gt; IdInfo) -&gt; Id -&gt; Id
</span><a href="GHC.Types.Id.html#modifyIdInfo"><span class="hs-identifier hs-var">modifyIdInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; Kind -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setLevityInfoWithType"><span class="hs-operator hs-var">`setLevityInfoWithType`</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095421"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095411"><span class="hs-identifier hs-var">builder_id</span></a></span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool) -&gt; TcM (Maybe (Id, Bool))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id, Bool) -&gt; Maybe (Id, Bool)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095410"><span class="hs-identifier hs-var">builder_id'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095417"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-812"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-813"></span><span>
</span><span id="line-814"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderBind"><span class="hs-identifier hs-type">tcPatSynBuilderBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-815"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-816"></span><span class="hs-comment">-- See Note [Matchers and builders for pattern synonyms] in GHC.Core.PatSyn</span><span>
</span><span id="line-817"></span><span id="tcPatSynBuilderBind"><span class="annot"><span class="annottext">tcPatSynBuilderBind :: PatSynBind GhcRn GhcRn -&gt; TcM (LHsBinds GhcTc)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderBind"><span class="hs-identifier hs-var hs-var">tcPatSynBuilderBind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095408"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095408"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095407"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-818"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_def :: forall idL idR. PatSynBind idL idR -&gt; LPat idR
</span><a href="GHC.Hs.Binds.html#psb_def"><span class="hs-identifier hs-var">psb_def</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095406"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095406"><span class="hs-identifier hs-var">lpat</span></a></span></span><span>
</span><span id="line-819"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_dir :: forall idL idR. PatSynBind idL idR -&gt; HsPatSynDir idR
</span><a href="GHC.Hs.Binds.html#psb_dir"><span class="hs-identifier hs-var">psb_dir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095405"><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095405"><span class="hs-identifier hs-var">dir</span></a></span></span><span>
</span><span id="line-820"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_args :: forall idL idR.
PatSynBind idL idR -&gt; HsPatSynDetails (Located (IdP idR))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095404"><span class="annot"><span class="annottext">HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095404"><span class="hs-identifier hs-var">details</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-821"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn -&gt; Bool
forall a. HsPatSynDir a -&gt; Bool
</span><a href="GHC.Tc.TyCl.PatSyn.html#isUnidirectional"><span class="hs-identifier hs-var">isUnidirectional</span></a></span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095405"><span class="hs-identifier hs-var">dir</span></a></span><span>
</span><span id="line-822"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span>
</span><span id="line-823"></span><span>
</span><span id="line-824"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681095403"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095403"><span class="hs-identifier hs-var">why</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
</span><a href="#local-6989586621681095402"><span class="hs-identifier hs-var">mb_match_group</span></a></span><span>       </span><span class="hs-comment">-- Can't invert the pattern</span><span>
</span><span id="line-825"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681095406"><span class="hs-identifier hs-var">lpat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc))
-&gt; TcM (LHsBinds GhcTc) -&gt; TcM (LHsBinds GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (LHsBinds GhcTc)
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcM (LHsBinds GhcTc)) -&gt; MsgDoc -&gt; TcM (LHsBinds GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-826"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Invalid right-hand side of bidirectional pattern synonym&quot;</span></span><span>
</span><span id="line-827"></span><span>                 </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-828"></span><span>              </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095403"><span class="hs-identifier hs-var">why</span></a></span><span>
</span><span id="line-829"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RHS pattern:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681095406"><span class="hs-identifier hs-var">lpat</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-830"></span><span>
</span><span id="line-831"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681095401"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095401"><span class="hs-identifier hs-var">match_group</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
</span><a href="#local-6989586621681095402"><span class="hs-identifier hs-var">mb_match_group</span></a></span><span>  </span><span class="hs-comment">-- Bidirectional</span><span>
</span><span id="line-832"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095400"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095400"><span class="hs-identifier hs-var">patsyn</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM PatSyn
</span><a href="GHC.Tc.Utils.Env.html#tcLookupPatSyn"><span class="hs-identifier hs-var">tcLookupPatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-833"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Maybe (Id, Bool)
</span><a href="GHC.Core.PatSyn.html#patSynBuilder"><span class="hs-identifier hs-var">patSynBuilder</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095400"><span class="hs-identifier hs-var">patsyn</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-834"></span><span>           </span><span class="annot"><span class="annottext">Maybe (Id, Bool)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-835"></span><span>             </span><span class="hs-comment">-- This case happens if we found a type error in the</span><span>
</span><span id="line-836"></span><span>             </span><span class="hs-comment">-- pattern synonym, recovered, and put a placeholder</span><span>
</span><span id="line-837"></span><span>             </span><span class="hs-comment">-- with patSynBuilder=Nothing in the environment</span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095397"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095397"><span class="hs-identifier hs-var">builder_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095396"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095396"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="hs-comment">-- Normal case</span><span>
</span><span id="line-840"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Bidirectional, so patSynBuilder returns Just</span><span>
</span><span id="line-841"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095395"><span class="annot"><span class="annottext">match_group' :: MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095395"><span class="hs-identifier hs-var hs-var">match_group'</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095396"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095394"><span class="hs-identifier hs-var">add_dummy_arg</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095401"><span class="hs-identifier hs-var">match_group</span></a></span><span>
</span><span id="line-842"></span><span>                          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095401"><span class="hs-identifier hs-var">match_group</span></a></span><span>
</span><span id="line-843"></span><span>
</span><span id="line-844"></span><span>             </span><span id="local-6989586621681095393"><span class="annot"><span class="annottext">bind :: HsBindLR GhcRn GhcRn
</span><a href="#local-6989586621681095393"><span class="hs-identifier hs-var hs-var">bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FunBind :: forall idL idR.
XFunBind idL idR
-&gt; Located (IdP idL)
-&gt; MatchGroup idR (LHsExpr idR)
-&gt; [Tickish Id]
-&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: GenLocated SrcSpan (IdP GhcRn)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095408"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095397"><span class="hs-identifier hs-var">builder_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-845"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_matches :: MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095395"><span class="hs-identifier hs-var">match_group'</span></a></span><span>
</span><span id="line-846"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: XFunBind GhcRn GhcRn
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XFunBind GhcRn GhcRn
</span><a href="GHC.Types.Name.Set.html#emptyNameSet"><span class="hs-identifier hs-var">emptyNameSet</span></a></span><span>
</span><span id="line-847"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_tick :: [Tickish Id]
</span><a href="GHC.Hs.Binds.html#fun_tick"><span class="hs-identifier hs-var">fun_tick</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-848"></span><span>
</span><span id="line-849"></span><span>             </span><span id="local-6989586621681095390"><span class="annot"><span class="annottext">sig :: TcIdSigInfo
</span><a href="#local-6989586621681095390"><span class="hs-identifier hs-var hs-var">sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Id -&gt; TcIdSigInfo
</span><a href="GHC.Tc.Gen.Sig.html#completeSigFromId"><span class="hs-identifier hs-var">completeSigFromId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#PatSynCtxt"><span class="hs-identifier hs-var">PatSynCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095397"><span class="hs-identifier hs-var">builder_id</span></a></span><span>
</span><span id="line-850"></span><span>
</span><span id="line-851"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynBuilderBind {&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-852"></span><span>         </span><span class="annot"><span class="annottext">PatSyn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095400"><span class="hs-identifier hs-var">patsyn</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095397"><span class="hs-identifier hs-var">builder_id</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#dcolon"><span class="hs-identifier hs-var">dcolon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Kind -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095397"><span class="hs-identifier hs-var">builder_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-853"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095389"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095389"><span class="hs-identifier hs-var">builder_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcPragEnv
-&gt; TcIdSigInfo -&gt; LHsBind GhcRn -&gt; TcM (LHsBinds GhcTc, [Id])
</span><a href="GHC.Tc.Gen.Bind.html#tcPolyCheck"><span class="hs-identifier hs-var">tcPolyCheck</span></a></span><span> </span><span class="annot"><span class="annottext">TcPragEnv
</span><a href="GHC.Tc.Gen.Sig.html#emptyPragEnv"><span class="hs-identifier hs-var">emptyPragEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcIdSigInfo
</span><a href="#local-6989586621681095390"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcRn -&gt; LHsBind GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcRn
</span><a href="#local-6989586621681095393"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-854"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynBuilderBind }&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095389"><span class="hs-identifier hs-var">builder_binds</span></a></span><span>
</span><span id="line-855"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; TcM (LHsBinds GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681095389"><span class="hs-identifier hs-var">builder_binds</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-cpp">

#if __GLASGOW_HASKELL__ &lt;= 810
</span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">panic</span><span> </span><span class="hs-string">&quot;tcPatSynBuilderBind&quot;</span><span>  </span><span class="hs-comment">-- Both cases dealt with</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-861"></span><span>    </span><span id="local-6989586621681095402"><span class="annot"><span class="annottext">mb_match_group :: Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
</span><a href="#local-6989586621681095402"><span class="hs-identifier hs-var hs-var">mb_match_group</span></a></span></span><span>
</span><span id="line-862"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681095405"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-863"></span><span>           </span><span class="annot"><a href="GHC.Hs.Binds.html#ExplicitBidirectional"><span class="hs-identifier hs-type">ExplicitBidirectional</span></a></span><span> </span><span id="local-6989586621681095387"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095387"><span class="hs-identifier hs-var">explicit_mg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095387"><span class="hs-identifier hs-var">explicit_mg</span></a></span><span>
</span><span id="line-864"></span><span>           </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="GHC.Hs.Binds.html#ImplicitBidirectional"><span class="hs-identifier hs-var">ImplicitBidirectional</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; MatchGroup GhcRn (LHsExpr GhcRn))
-&gt; Either MsgDoc (LHsExpr GhcRn)
-&gt; Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095386"><span class="hs-identifier hs-var">mk_mg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
-&gt; [Located Name] -&gt; LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatToExpr"><span class="hs-identifier hs-var">tcPatToExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
[GenLocated SrcSpan (IdP GhcRn)]
</span><a href="#local-6989586621681095384"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095406"><span class="hs-identifier hs-var">lpat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-865"></span><span>           </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="GHC.Hs.Binds.html#Unidirectional"><span class="hs-identifier hs-var">Unidirectional</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either MsgDoc (MatchGroup GhcRn (LHsExpr GhcRn))
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcPatSynBuilderBind&quot;</span></span><span>
</span><span id="line-866"></span><span>
</span><span id="line-867"></span><span>    </span><span class="annot"><a href="#local-6989586621681095386"><span class="hs-identifier hs-type">mk_mg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-868"></span><span>    </span><span id="local-6989586621681095386"><span class="annot"><span class="annottext">mk_mg :: LHsExpr GhcRn -&gt; MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095386"><span class="hs-identifier hs-var hs-var">mk_mg</span></a></span></span><span> </span><span id="local-6989586621681095383"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681095383"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
-&gt; [LMatch GhcRn (LHsExpr GhcRn)]
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
forall name (body :: * -&gt; *).
(XMG name (Located (body name)) ~ NoExtField) =&gt;
Origin
-&gt; [LMatch name (Located (body name))]
-&gt; MatchGroup name (Located (body name))
</span><a href="GHC.Hs.Utils.html#mkMatchGroup"><span class="hs-identifier hs-var">mkMatchGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#Generated"><span class="hs-identifier hs-var">Generated</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LMatch GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095381"><span class="hs-identifier hs-var">builder_match</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-869"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-870"></span><span>            </span><span id="local-6989586621681095380"><span class="annot"><span class="annottext">builder_args :: [Located (Pat GhcRn)]
</span><a href="#local-6989586621681095380"><span class="hs-identifier hs-var hs-var">builder_args</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan -&gt; Pat GhcRn -&gt; Located (Pat GhcRn)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095379"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XVarPat GhcRn -&gt; GenLocated SrcSpan (IdP GhcRn) -&gt; Pat GhcRn
forall p. XVarPat p -&gt; Located (IdP p) -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#VarPat"><span class="hs-identifier hs-var">VarPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVarPat GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095379"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095377"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-871"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095379"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095379"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095377"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095377"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located Name]
[GenLocated SrcSpan (IdP GhcRn)]
</span><a href="#local-6989586621681095384"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-872"></span><span>            </span><span id="local-6989586621681095381"><span class="annot"><span class="annottext">builder_match :: LMatch GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095381"><span class="hs-identifier hs-var hs-var">builder_match</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcRn)
-&gt; [LPat GhcRn]
-&gt; LHsExpr GhcRn
-&gt; Located (HsLocalBinds GhcRn)
-&gt; LMatch GhcRn (LHsExpr GhcRn)
forall (p :: Pass).
IsPass p =&gt;
HsMatchContext (NoGhcTc (GhcPass p))
-&gt; [LPat (GhcPass p)]
-&gt; LHsExpr (GhcPass p)
-&gt; Located (HsLocalBinds (GhcPass p))
-&gt; LMatch (GhcPass p) (LHsExpr (GhcPass p))
</span><a href="GHC.Hs.Utils.html#mkMatch"><span class="hs-identifier hs-var">mkMatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn) -&gt; HsMatchContext GhcRn
forall p. LIdP p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Utils.html#mkPrefixFunRhs"><span class="hs-identifier hs-var">mkPrefixFunRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095408"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095407"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-873"></span><span>                                    </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681095380"><span class="hs-identifier hs-var">builder_args</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681095383"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-874"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; Located (HsLocalBinds GhcRn)
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XEmptyLocalBinds GhcRn GhcRn -&gt; HsLocalBinds GhcRn
forall idL idR. XEmptyLocalBinds idL idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#EmptyLocalBinds"><span class="hs-identifier hs-var">EmptyLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XEmptyLocalBinds GhcRn GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-875"></span><span>
</span><span id="line-876"></span><span>    </span><span id="local-6989586621681095384"><span class="annot"><span class="annottext">args :: [GenLocated SrcSpan (IdP GhcRn)]
</span><a href="#local-6989586621681095384"><span class="hs-identifier hs-var hs-var">args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (GenLocated SrcSpan (IdP GhcRn))
</span><a href="#local-6989586621681095404"><span class="hs-identifier hs-var">details</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-877"></span><span>              </span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span id="local-6989586621681095376"><span class="annot"><span class="annottext">[GenLocated SrcSpan (IdP GhcRn)]
</span><a href="#local-6989586621681095376"><span class="hs-identifier hs-var">args</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (IdP GhcRn)]
</span><a href="#local-6989586621681095376"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-878"></span><span>              </span><span class="annot"><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-type">InfixCon</span></a></span><span> </span><span id="local-6989586621681095375"><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095375"><span class="hs-identifier hs-var">arg1</span></a></span></span><span> </span><span id="local-6989586621681095374"><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095374"><span class="hs-identifier hs-var">arg2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095375"><span class="hs-identifier hs-var">arg1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095374"><span class="hs-identifier hs-var">arg2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-879"></span><span>              </span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681095373"><span class="annot"><span class="annottext">[RecordPatSynField (GenLocated SrcSpan (IdP GhcRn))]
</span><a href="#local-6989586621681095373"><span class="hs-identifier hs-var">args</span></a></span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(RecordPatSynField (Located Name) -&gt; Located Name)
-&gt; [RecordPatSynField (Located Name)] -&gt; [Located Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located Name) -&gt; Located Name
forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynPatVar"><span class="hs-identifier hs-var hs-var">recordPatSynPatVar</span></a></span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
[RecordPatSynField (GenLocated SrcSpan (IdP GhcRn))]
</span><a href="#local-6989586621681095373"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-880"></span><span>
</span><span id="line-881"></span><span>    </span><span class="annot"><a href="#local-6989586621681095394"><span class="hs-identifier hs-type">add_dummy_arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-882"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-883"></span><span>    </span><span id="local-6989586621681095394"><span class="annot"><span class="annottext">add_dummy_arg :: MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095394"><span class="hs-identifier hs-var hs-var">add_dummy_arg</span></a></span></span><span> </span><span id="local-6989586621681095372"><span class="annot"><span class="annottext">mg :: MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095372"><span class="hs-identifier hs-var">mg</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-884"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095371"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095371"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095370"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095370"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095369"><span class="annot"><span class="annottext">match :: Match GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095369"><span class="hs-identifier hs-var">match</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095366"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095366"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-885"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095372"><span class="hs-identifier hs-var">mg</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch GhcRn (LHsExpr GhcRn)]
-&gt; GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095371"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SrcSpan
-&gt; Match GhcRn (LHsExpr GhcRn) -&gt; LMatch GhcRn (LHsExpr GhcRn)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095370"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095369"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: [LPat GhcRn]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="GHC.Hs.Utils.html#nlWildPatName"><span class="hs-identifier hs-var">nlWildPatName</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
-&gt; [Located (Pat GhcRn)] -&gt; [Located (Pat GhcRn)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681095366"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-886"></span><span>    </span><span class="annot"><a href="#local-6989586621681095394"><span class="hs-identifier hs-var">add_dummy_arg</span></a></span><span> </span><span id="local-6989586621681095364"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095364"><span class="hs-identifier hs-var">other_mg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; MatchGroup GhcRn (LHsExpr GhcRn)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;add_dummy_arg&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; MatchGroup GhcRn (LHsExpr GhcRn))
-&gt; MsgDoc -&gt; MatchGroup GhcRn (LHsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-887"></span><span>                             </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; MsgDoc
forall (idR :: Pass) body.
(OutputableBndrId idR, Outputable body) =&gt;
MatchGroup (GhcPass idR) body -&gt; MsgDoc
</span><a href="GHC.Hs.Expr.html#pprMatches"><span class="hs-identifier hs-var">pprMatches</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095364"><span class="hs-identifier hs-var">other_mg</span></a></span><span>
</span><span id="line-888"></span><span>
</span><span id="line-889"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderOcc"><span class="hs-identifier hs-type">tcPatSynBuilderOcc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.PatSyn.html#PatSyn"><span class="hs-identifier hs-type">PatSyn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcSigmaType"><span class="hs-identifier hs-type">TcSigmaType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-890"></span><span class="hs-comment">-- monadic only for failure</span><span>
</span><span id="line-891"></span><span id="tcPatSynBuilderOcc"><span class="annot"><span class="annottext">tcPatSynBuilderOcc :: PatSyn -&gt; TcM (HsExpr GhcTc, Kind)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatSynBuilderOcc"><span class="hs-identifier hs-var hs-var">tcPatSynBuilderOcc</span></a></span></span><span> </span><span id="local-6989586621681095360"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095360"><span class="hs-identifier hs-var">ps</span></a></span></span><span>
</span><span id="line-892"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095359"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095359"><span class="hs-identifier hs-var">builder_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095358"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095358"><span class="hs-identifier hs-var">add_void_arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (Id, Bool)
</span><a href="#local-6989586621681095357"><span class="hs-identifier hs-var">builder</span></a></span><span>
</span><span id="line-893"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681095356"><span class="annot"><span class="annottext">builder_expr :: HsExpr GhcTc
</span><a href="#local-6989586621681095356"><span class="hs-identifier hs-var hs-var">builder_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XConLikeOut GhcTc -&gt; ConLike -&gt; HsExpr GhcTc
forall p. XConLikeOut p -&gt; ConLike -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsConLikeOut"><span class="hs-identifier hs-var">HsConLikeOut</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XConLikeOut GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSyn -&gt; ConLike
</span><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-var">PatSynCon</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095360"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-894"></span><span>        </span><span id="local-6989586621681095354"><span class="annot"><span class="annottext">builder_ty :: Kind
</span><a href="#local-6989586621681095354"><span class="hs-identifier hs-var hs-var">builder_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Kind
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681095359"><span class="hs-identifier hs-var">builder_id</span></a></span><span>
</span><span id="line-895"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc, Kind) -&gt; TcM (HsExpr GhcTc, Kind)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((HsExpr GhcTc, Kind) -&gt; TcM (HsExpr GhcTc, Kind))
-&gt; (HsExpr GhcTc, Kind) -&gt; TcM (HsExpr GhcTc, Kind)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-896"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095358"><span class="hs-identifier hs-var">add_void_arg</span></a></span><span>
</span><span id="line-897"></span><span>    </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681095356"><span class="hs-identifier hs-var">builder_expr</span></a></span><span>   </span><span class="hs-comment">-- still just return builder_expr; the void# arg is added</span><span>
</span><span id="line-898"></span><span>                          </span><span class="hs-comment">-- by dsConLike in the desugarer</span><span>
</span><span id="line-899"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind
</span><a href="GHC.Tc.Utils.TcType.html#tcFunResultTy"><span class="hs-identifier hs-var">tcFunResultTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095354"><span class="hs-identifier hs-var">builder_ty</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-900"></span><span>    </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681095356"><span class="hs-identifier hs-var">builder_expr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095354"><span class="hs-identifier hs-var">builder_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-901"></span><span>
</span><span id="line-902"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-comment">-- Unidirectional</span><span>
</span><span id="line-903"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM (HsExpr GhcTc, Kind)
forall name a. Outputable name =&gt; name -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#nonBidirectionalErr"><span class="hs-identifier hs-var">nonBidirectionalErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095352"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-904"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-905"></span><span>    </span><span id="local-6989586621681095352"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681095352"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Name
</span><a href="GHC.Core.PatSyn.html#patSynName"><span class="hs-identifier hs-var">patSynName</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095360"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-906"></span><span>    </span><span id="local-6989586621681095357"><span class="annot"><span class="annottext">builder :: Maybe (Id, Bool)
</span><a href="#local-6989586621681095357"><span class="hs-identifier hs-var hs-var">builder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; Maybe (Id, Bool)
</span><a href="GHC.Core.PatSyn.html#patSynBuilder"><span class="hs-identifier hs-var">patSynBuilder</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621681095360"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-907"></span><span>
</span><span id="line-908"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#add_void"><span class="hs-identifier hs-type">add_void</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-909"></span><span id="add_void"><span class="annot"><span class="annottext">add_void :: Bool -&gt; Kind -&gt; Kind
</span><a href="GHC.Tc.TyCl.PatSyn.html#add_void"><span class="hs-identifier hs-var hs-var">add_void</span></a></span></span><span> </span><span id="local-6989586621681095350"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095350"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span></span><span> </span><span id="local-6989586621681095349"><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095349"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-910"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681095350"><span class="hs-identifier hs-var">need_dummy_arg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind -&gt; Kind -&gt; Kind
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="GHC.Builtin.Types.Prim.html#voidPrimTy"><span class="hs-identifier hs-var">voidPrimTy</span></a></span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095349"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-911"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Kind
</span><a href="#local-6989586621681095349"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-912"></span><span>
</span><span id="line-913"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcPatToExpr"><span class="hs-identifier hs-type">tcPatToExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-914"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-915"></span><span class="hs-comment">-- Given a /pattern/, return an /expression/ that builds a value</span><span>
</span><span id="line-916"></span><span class="hs-comment">-- that matches the pattern.  E.g. if the pattern is (Just [x]),</span><span>
</span><span id="line-917"></span><span class="hs-comment">-- the expression is (Just [x]).  They look the same, but the</span><span>
</span><span id="line-918"></span><span class="hs-comment">-- input uses constructors from HsPat and the output uses constructors</span><span>
</span><span id="line-919"></span><span class="hs-comment">-- from HsExpr.</span><span>
</span><span id="line-920"></span><span class="hs-comment">--</span><span>
</span><span id="line-921"></span><span class="hs-comment">-- Returns (Left r) if the pattern is not invertible, for reason r.</span><span>
</span><span id="line-922"></span><span class="hs-comment">-- See Note [Builder for a bidirectional pattern synonym]</span><span>
</span><span id="line-923"></span><span id="tcPatToExpr"><span class="annot"><span class="annottext">tcPatToExpr :: Name
-&gt; [Located Name] -&gt; LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcPatToExpr"><span class="hs-identifier hs-var hs-var">tcPatToExpr</span></a></span></span><span> </span><span id="local-6989586621681095348"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095348"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681095347"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681095347"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681095346"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095346"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095346"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-924"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-925"></span><span>    </span><span id="local-6989586621681095344"><span class="annot"><span class="annottext">lhsVars :: NameSet
</span><a href="#local-6989586621681095344"><span class="hs-identifier hs-var hs-var">lhsVars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name) -&gt; [Located Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681095347"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-926"></span><span>
</span><span id="line-927"></span><span>    </span><span class="hs-comment">-- Make a prefix con for prefix and infix patterns for simplicity</span><span>
</span><span id="line-928"></span><span>    </span><span class="annot"><a href="#local-6989586621681095342"><span class="hs-identifier hs-type">mkPrefixConExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-929"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-930"></span><span>    </span><span id="local-6989586621681095342"><span class="annot"><span class="annottext">mkPrefixConExpr :: Located Name -&gt; [LPat GhcRn] -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095342"><span class="hs-identifier hs-var hs-var">mkPrefixConExpr</span></a></span></span><span> </span><span id="local-6989586621681095341"><span class="annot"><span class="annottext">lcon :: Located Name
</span><a href="#local-6989586621681095341"><span class="hs-identifier hs-var">lcon</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095340"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095340"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681095339"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095339"><span class="hs-identifier hs-var">pats</span></a></span></span><span>
</span><span id="line-931"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095338"><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095338"><span class="hs-identifier hs-var">exprs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn))
-&gt; [Located (Pat GhcRn)] -&gt; Either MsgDoc [LHsExpr GhcRn]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn)
LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681095339"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-932"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; LHsExpr GhcRn -&gt; HsExpr GhcRn)
-&gt; HsExpr GhcRn -&gt; [LHsExpr GhcRn] -&gt; HsExpr GhcRn
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681095337"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095337"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681095336"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681095336"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">XApp GhcRn -&gt; LHsExpr GhcRn -&gt; LHsExpr GhcRn -&gt; HsExpr GhcRn
forall p. XApp p -&gt; LHsExpr p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-var">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XApp GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr GhcRn -&gt; LHsExpr GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095340"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095337"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681095336"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-933"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XVar GhcRn -&gt; GenLocated SrcSpan (IdP GhcRn) -&gt; HsExpr GhcRn
forall p. XVar p -&gt; Located (IdP p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-var">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVar GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095341"><span class="hs-identifier hs-var">lcon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095338"><span class="hs-identifier hs-var">exprs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-934"></span><span>
</span><span id="line-935"></span><span>    </span><span class="annot"><a href="#local-6989586621681095333"><span class="hs-identifier hs-type">mkRecordConExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecFields"><span class="hs-identifier hs-type">HsRecFields</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-936"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-937"></span><span>    </span><span id="local-6989586621681095333"><span class="annot"><span class="annottext">mkRecordConExpr :: Located Name
-&gt; HsRecFields GhcRn (LPat GhcRn) -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095333"><span class="hs-identifier hs-var hs-var">mkRecordConExpr</span></a></span></span><span> </span><span id="local-6989586621681095332"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681095332"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681095331"><span class="annot"><span class="annottext">HsRecFields GhcRn (LPat GhcRn)
</span><a href="#local-6989586621681095331"><span class="hs-identifier hs-var">fields</span></a></span></span><span>
</span><span id="line-938"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095330"><span class="annot"><span class="annottext">HsRecFields GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095330"><span class="hs-identifier hs-var">exprFields</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn))
-&gt; HsRecFields GhcRn (Located (Pat GhcRn))
-&gt; Either MsgDoc (HsRecFields GhcRn (LHsExpr GhcRn))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn)
LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">HsRecFields GhcRn (Located (Pat GhcRn))
HsRecFields GhcRn (LPat GhcRn)
</span><a href="#local-6989586621681095331"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-939"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XRecordCon GhcRn
-&gt; GenLocated SrcSpan (IdP GhcRn)
-&gt; HsRecFields GhcRn (LHsExpr GhcRn)
-&gt; HsExpr GhcRn
forall p.
XRecordCon p -&gt; Located (IdP p) -&gt; HsRecordBinds p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#RecordCon"><span class="hs-identifier hs-var">RecordCon</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XRecordCon GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
GenLocated SrcSpan (IdP GhcRn)
</span><a href="#local-6989586621681095332"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">HsRecFields GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681095330"><span class="hs-identifier hs-var">exprFields</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-940"></span><span>
</span><span id="line-941"></span><span>    </span><span class="annot"><a href="#local-6989586621681095345"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-942"></span><span>    </span><span id="local-6989586621681095345"><span class="annot"><span class="annottext">go :: LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095328"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095328"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681095327"><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095327"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr GhcRn -&gt; LHsExpr GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095328"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; LHsExpr GhcRn)
-&gt; Either MsgDoc (HsExpr GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095327"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-943"></span><span>
</span><span id="line-944"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-type">go1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#MsgDoc"><span class="hs-identifier hs-type">MsgDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-945"></span><span>    </span><span id="local-6989586621681095325"><span class="annot"><span class="annottext">go1 :: Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095325"><span class="hs-identifier hs-var hs-var">go1</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ConPat"><span class="hs-identifier hs-type">ConPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XConPat GhcRn
</span><a href="GHC.Hs.Extension.html#NoExtField"><span class="hs-identifier hs-var">NoExtField</span></a></span><span> </span><span id="local-6989586621681095322"><span class="annot"><span class="annottext">Located (ConLikeP GhcRn)
</span><a href="#local-6989586621681095322"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span id="local-6989586621681095321"><span class="annot"><span class="annottext">HsConPatDetails GhcRn
</span><a href="#local-6989586621681095321"><span class="hs-identifier hs-var">info</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-946"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsConPatDetails GhcRn
</span><a href="#local-6989586621681095321"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-947"></span><span>          </span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span id="local-6989586621681095320"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095320"><span class="hs-identifier hs-var">ps</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; [LPat GhcRn] -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095342"><span class="hs-identifier hs-var">mkPrefixConExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (ConLikeP GhcRn)
</span><a href="#local-6989586621681095322"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095320"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-948"></span><span>          </span><span class="annot"><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-type">InfixCon</span></a></span><span> </span><span id="local-6989586621681095319"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095319"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681095318"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095318"><span class="hs-identifier hs-var">r</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; [LPat GhcRn] -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095342"><span class="hs-identifier hs-var">mkPrefixConExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (ConLikeP GhcRn)
</span><a href="#local-6989586621681095322"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095319"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095318"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-949"></span><span>          </span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681095317"><span class="annot"><span class="annottext">HsRecFields GhcRn (LPat GhcRn)
</span><a href="#local-6989586621681095317"><span class="hs-identifier hs-var">fields</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; HsRecFields GhcRn (LPat GhcRn) -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095333"><span class="hs-identifier hs-var">mkRecordConExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (ConLikeP GhcRn)
</span><a href="#local-6989586621681095322"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">HsRecFields GhcRn (LPat GhcRn)
</span><a href="#local-6989586621681095317"><span class="hs-identifier hs-var">fields</span></a></span><span>
</span><span id="line-950"></span><span>
</span><span id="line-951"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SigPat"><span class="hs-identifier hs-type">SigPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSigPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095315"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095315"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsPatSigType (NoGhcTc GhcRn)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Pat GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681095315"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-952"></span><span>        </span><span class="hs-comment">-- See Note [Type signatures and the builder expression]</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#VarPat"><span class="hs-identifier hs-type">VarPat</span></a></span><span> </span><span class="annot"><span class="annottext">XVarPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681095314"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095314"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681095313"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681095313"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-955"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095313"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; NameSet -&gt; Bool
</span><a href="GHC.Types.Name.Set.html#elemNameSet"><span class="hs-operator hs-var">`elemNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681095344"><span class="hs-identifier hs-var">lhsVars</span></a></span><span>
</span><span id="line-956"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XVar GhcRn -&gt; GenLocated SrcSpan (IdP GhcRn) -&gt; HsExpr GhcRn
forall p. XVar p -&gt; Located (IdP p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-var">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVar GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681095314"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095313"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-957"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-958"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681095313"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not bound by the LHS of the pattern synonym&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-959"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-type">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095310"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095310"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; HsExpr GhcRn)
-&gt; Either MsgDoc (LHsExpr GhcRn) -&gt; Either MsgDoc (HsExpr GhcRn)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPar GhcRn -&gt; LHsExpr GhcRn -&gt; HsExpr GhcRn
forall p. XPar p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-var">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XPar GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Either MsgDoc (LHsExpr GhcRn) -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; Either MsgDoc (LHsExpr GhcRn) -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095310"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-960"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095308"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095308"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span id="local-6989586621681095306"><span class="annot"><span class="annottext">XListPat GhcRn
</span><a href="#local-6989586621681095306"><span class="hs-identifier hs-var">reb</span></a></span></span><span> </span><span id="local-6989586621681095305"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095305"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-961"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprRn
XListPat GhcRn
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">XListPat GhcRn
</span><a href="#local-6989586621681095306"><span class="hs-identifier hs-var">reb</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095304"><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095304"><span class="hs-identifier hs-var">exprs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn))
-&gt; [Located (Pat GhcRn)] -&gt; Either MsgDoc [LHsExpr GhcRn]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn)
LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681095305"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-962"></span><span>                            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitList GhcRn
-&gt; Maybe (SyntaxExpr GhcRn) -&gt; [LHsExpr GhcRn] -&gt; HsExpr GhcRn
forall p.
XExplicitList p -&gt; Maybe (SyntaxExpr p) -&gt; [LHsExpr p] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#ExplicitList"><span class="hs-identifier hs-var">ExplicitList</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XExplicitList GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095304"><span class="hs-identifier hs-var">exprs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-963"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095302"><span class="hs-identifier hs-var">notInvertibleListPat</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095308"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-964"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#TuplePat"><span class="hs-identifier hs-type">TuplePat</span></a></span><span> </span><span class="annot"><span class="annottext">XTuplePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095300"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681095300"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span id="local-6989586621681095299"><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621681095299"><span class="hs-identifier hs-var">box</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095298"><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095298"><span class="hs-identifier hs-var">exprs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn))
-&gt; [Located (Pat GhcRn)] -&gt; Either MsgDoc [LHsExpr GhcRn]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Either MsgDoc (LHsExpr GhcRn)
LPat GhcRn -&gt; Either MsgDoc (LHsExpr GhcRn)
</span><a href="#local-6989586621681095345"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681095300"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-965"></span><span>                                         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitTuple GhcRn -&gt; [LHsTupArg GhcRn] -&gt; Boxity -&gt; HsExpr GhcRn
forall p. XExplicitTuple p -&gt; [LHsTupArg p] -&gt; Boxity -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#ExplicitTuple"><span class="hs-identifier hs-var">ExplicitTuple</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XExplicitTuple GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-966"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; LHsTupArg GhcRn)
-&gt; [LHsExpr GhcRn] -&gt; [LHsTupArg GhcRn]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsTupArg GhcRn -&gt; LHsTupArg GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsTupArg GhcRn -&gt; LHsTupArg GhcRn)
-&gt; (LHsExpr GhcRn -&gt; HsTupArg GhcRn)
-&gt; LHsExpr GhcRn
-&gt; LHsTupArg GhcRn
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPresent GhcRn -&gt; LHsExpr GhcRn -&gt; HsTupArg GhcRn
forall id. XPresent id -&gt; LHsExpr id -&gt; HsTupArg id
</span><a href="GHC.Hs.Expr.html#Present"><span class="hs-identifier hs-var">Present</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XPresent GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsExpr GhcRn]
</span><a href="#local-6989586621681095298"><span class="hs-identifier hs-var">exprs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-967"></span><span>                                                                           </span><span class="annot"><span class="annottext">Boxity
</span><a href="#local-6989586621681095299"><span class="hs-identifier hs-var">box</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-968"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SumPat"><span class="hs-identifier hs-type">SumPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSumPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095294"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681095294"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681095293"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095293"><span class="hs-identifier hs-var">alt</span></a></span></span><span> </span><span id="local-6989586621681095292"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095292"><span class="hs-identifier hs-var">arity</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681095291"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095291"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Pat GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681095294"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-969"></span><span>                                         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XExplicitSum GhcRn -&gt; Int -&gt; Int -&gt; LHsExpr GhcRn -&gt; HsExpr GhcRn
forall p. XExplicitSum p -&gt; Int -&gt; Int -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#ExplicitSum"><span class="hs-identifier hs-var">ExplicitSum</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XExplicitSum GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095293"><span class="hs-identifier hs-var">alt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681095292"><span class="hs-identifier hs-var">arity</span></a></span><span>
</span><span id="line-970"></span><span>                                                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; LHsExpr GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095291"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-971"></span><span>                                         </span><span class="hs-special">}</span><span>
</span><span id="line-972"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LitPat"><span class="hs-identifier hs-type">LitPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLitPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095288"><span class="annot"><span class="annottext">HsLit GhcRn
</span><a href="#local-6989586621681095288"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XLitE GhcRn -&gt; HsLit GhcRn -&gt; HsExpr GhcRn
forall p. XLitE p -&gt; HsLit p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsLit"><span class="hs-identifier hs-var">HsLit</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLitE GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsLit GhcRn
</span><a href="#local-6989586621681095288"><span class="hs-identifier hs-var">lit</span></a></span><span>
</span><span id="line-973"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPat"><span class="hs-identifier hs-type">NPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095285"><span class="annot"><span class="annottext">HsOverLit GhcRn
</span><a href="#local-6989586621681095285"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681095284"><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcRn)
</span><a href="#local-6989586621681095284"><span class="hs-identifier hs-var">mb_neg</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-974"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExprRn"><span class="hs-identifier hs-type">SyntaxExprRn</span></a></span><span> </span><span id="local-6989586621681095282"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095282"><span class="hs-identifier hs-var">neg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (SyntaxExpr GhcRn)
</span><a href="#local-6989586621681095284"><span class="hs-identifier hs-var">mb_neg</span></a></span><span>
</span><span id="line-975"></span><span>                                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; HsExpr GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; HsExpr GhcRn) -&gt; LHsExpr GhcRn -&gt; HsExpr GhcRn
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; LHsExpr GhcRn -&gt; LHsExpr GhcRn)
-&gt; LHsExpr GhcRn -&gt; [LHsExpr GhcRn] -&gt; LHsExpr GhcRn
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; LHsExpr GhcRn -&gt; LHsExpr GhcRn
forall (id :: Pass).
IsPass id =&gt;
LHsExpr (GhcPass id)
-&gt; LHsExpr (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsApp"><span class="hs-identifier hs-var">nlHsApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; LHsExpr GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681095282"><span class="hs-identifier hs-var">neg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-976"></span><span>                                                       </span><span class="hs-special">[</span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; LHsExpr GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XOverLitE GhcRn -&gt; HsOverLit GhcRn -&gt; HsExpr GhcRn
forall p. XOverLitE p -&gt; HsOverLit p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsOverLit"><span class="hs-identifier hs-var">HsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XOverLitE GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcRn
</span><a href="#local-6989586621681095285"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-977"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn))
-&gt; HsExpr GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XOverLitE GhcRn -&gt; HsOverLit GhcRn -&gt; HsExpr GhcRn
forall p. XOverLitE p -&gt; HsOverLit p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsOverLit"><span class="hs-identifier hs-var">HsOverLit</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XOverLitE GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcRn
</span><a href="#local-6989586621681095285"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-978"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">XSplicePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliced GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ThModFinalizers
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplicedPat"><span class="hs-identifier hs-type">HsSplicedPat</span></a></span><span> </span><span id="local-6989586621681095277"><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095277"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-979"></span><span>                                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095277"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-980"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">XSplicePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Either MsgDoc (HsExpr GhcRn)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Invalid splice variety&quot;</span></span><span>
</span><span id="line-981"></span><span>
</span><span id="line-982"></span><span>    </span><span class="hs-comment">-- The following patterns are not invertible.</span><span>
</span><span id="line-983"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095276"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095276"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095276"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-comment">-- #14112</span><span>
</span><span id="line-984"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095273"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095273"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LazyPat"><span class="hs-identifier hs-type">LazyPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095273"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-985"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095271"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095271"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-type">WildPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095271"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-986"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095270"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095270"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-type">AsPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095270"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-987"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095268"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095268"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095268"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-988"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095266"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095266"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095266"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-989"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095264"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095264"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">XSplicePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095264"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-990"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095262"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095262"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">XSplicePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095262"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-991"></span><span>    </span><span class="annot"><a href="#local-6989586621681095325"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095260"><span class="annot"><span class="annottext">p :: Pat GhcRn
</span><a href="#local-6989586621681095260"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">XSplicePat GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var">notInvertible</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095260"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-992"></span><span>
</span><span id="line-993"></span><span>    </span><span id="local-6989586621681095274"><span class="annot"><span class="annottext">notInvertible :: Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095274"><span class="hs-identifier hs-var hs-var">notInvertible</span></a></span></span><span> </span><span id="local-6989586621681095258"><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095258"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcRn -&gt; MsgDoc
</span><a href="#local-6989586621681095257"><span class="hs-identifier hs-var">not_invertible_msg</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095258"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-994"></span><span>
</span><span id="line-995"></span><span>    </span><span id="local-6989586621681095257"><span class="annot"><span class="annottext">not_invertible_msg :: Pat GhcRn -&gt; MsgDoc
</span><a href="#local-6989586621681095257"><span class="hs-identifier hs-var hs-var">not_invertible_msg</span></a></span></span><span> </span><span id="local-6989586621681095256"><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095256"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-996"></span><span>      </span><span class="hs-glyph">=</span><span>   </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Pat GhcRn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095256"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not invertible&quot;</span></span><span>
</span><span id="line-997"></span><span>      </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%2B%24"><span class="hs-operator hs-var">$+$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Suggestion: instead use an explicitly bidirectional&quot;</span></span><span>
</span><span id="line-998"></span><span>                </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pattern synonym, e.g.&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-999"></span><span>             </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pattern&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095254"><span class="hs-identifier hs-var">pp_name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095253"><span class="hs-identifier hs-var">pp_args</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#larrow"><span class="hs-identifier hs-var">larrow</span></a></span><span>
</span><span id="line-1000"></span><span>                      </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681095346"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;where&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1001"></span><span>                   </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095254"><span class="hs-identifier hs-var">pp_name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681095253"><span class="hs-identifier hs-var">pp_args</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#equals"><span class="hs-identifier hs-var">equals</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;...&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1002"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-1003"></span><span>        </span><span id="local-6989586621681095254"><span class="annot"><span class="annottext">pp_name :: MsgDoc
</span><a href="#local-6989586621681095254"><span class="hs-identifier hs-var hs-var">pp_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681095348"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-1004"></span><span>        </span><span id="local-6989586621681095253"><span class="annot"><span class="annottext">pp_args :: MsgDoc
</span><a href="#local-6989586621681095253"><span class="hs-identifier hs-var hs-var">pp_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; MsgDoc) -&gt; [Located Name] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681095347"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1005"></span><span>
</span><span id="line-1006"></span><span>    </span><span class="hs-comment">-- We should really be able to invert list patterns, even when</span><span>
</span><span id="line-1007"></span><span>    </span><span class="hs-comment">-- rebindable syntax is on, but doing so involves a bit of</span><span>
</span><span id="line-1008"></span><span>    </span><span class="hs-comment">-- refactoring; see #14380.  Until then we reject with a</span><span>
</span><span id="line-1009"></span><span>    </span><span class="hs-comment">-- helpful error message.</span><span>
</span><span id="line-1010"></span><span>    </span><span id="local-6989586621681095302"><span class="annot"><span class="annottext">notInvertibleListPat :: Pat GhcRn -&gt; Either MsgDoc (HsExpr GhcRn)
</span><a href="#local-6989586621681095302"><span class="hs-identifier hs-var hs-var">notInvertibleListPat</span></a></span></span><span> </span><span id="local-6989586621681095249"><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095249"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-1011"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Either MsgDoc (HsExpr GhcRn)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Pat GhcRn -&gt; MsgDoc
</span><a href="#local-6989586621681095257"><span class="hs-identifier hs-var">not_invertible_msg</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcRn
</span><a href="#local-6989586621681095249"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1012"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Reason: rebindable syntax is on.&quot;</span></span><span>
</span><span id="line-1013"></span><span>                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This is fixable: add use-case to #14380&quot;</span></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1014"></span><span>
</span><span id="line-1015"></span><span class="hs-comment">{- Note [Builder for a bidirectional pattern synonym]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For a bidirectional pattern synonym we need to produce an /expression/
that matches the supplied /pattern/, given values for the arguments
of the pattern synonym.  For example
  pattern F x y = (Just x, [y])
The 'builder' for F looks like
  $builderF x y = (Just x, [y])

We can't always do this:
 * Some patterns aren't invertible; e.g. view patterns
      pattern F x = (reverse -&gt; x:_)

 * The RHS pattern might bind more variables than the pattern
   synonym, so again we can't invert it
      pattern F x = (x,y)

 * Ditto wildcards
      pattern F x = (x,_)


Note [Redundant constraints for builder]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The builder can have redundant constraints, which are awkward to eliminate.
Consider
   pattern P = Just 34
To match against this pattern we need (Eq a, Num a).  But to build
(Just 34) we need only (Num a).  Fortunately instTcSigFromId sets
sig_warn_redundant to False.

************************************************************************
*                                                                      *
         Helper functions
*                                                                      *
************************************************************************

Note [As-patterns in pattern synonym definitions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The rationale for rejecting as-patterns in pattern synonym definitions
is that an as-pattern would introduce nonindependent pattern synonym
arguments, e.g. given a pattern synonym like:

        pattern K x y = x@(Just y)

one could write a nonsensical function like

        f (K Nothing x) = ...

or
        g (K (Just True) False) = ...

Note [Type signatures and the builder expression]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
   pattern L x = Left x :: Either [a] [b]

In tc{Infer/Check}PatSynDecl we will check that the pattern has the
specified type.  We check the pattern *as a pattern*, so the type
signature is a pattern signature, and so brings 'a' and 'b' into
scope.  But we don't have a way to bind 'a, b' in the LHS, as we do
'x', say.  Nevertheless, the signature may be useful to constrain
the type.

When making the binding for the *builder*, though, we don't want
  $buildL x = Left x :: Either [a] [b]
because that wil either mean (forall a b. Either [a] [b]), or we'll
get a complaint that 'a' and 'b' are out of scope. (Actually the
latter; #9867.)  No, the job of the signature is done, so when
converting the pattern to an expression (for the builder RHS) we
simply discard the signature.

Note [Record PatSyn Desugaring]
-------------------------------
It is important that prov_theta comes before req_theta as this ordering is used
when desugaring record pattern synonym updates.

Any change to this ordering should make sure to change GHC.HsToCore.Expr if you
want to avoid difficult to decipher core lint errors!
 -}</span><span>
</span><span id="line-1094"></span><span>
</span><span id="line-1095"></span><span>
</span><span id="line-1096"></span><span id="local-6989586621681096214"><span id="local-6989586621681096215"><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#nonBidirectionalErr"><span class="hs-identifier hs-type">nonBidirectionalErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096215"><span class="hs-identifier hs-type">name</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681096215"><span class="hs-identifier hs-type">name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681096214"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-1097"></span><span id="nonBidirectionalErr"><span class="annot"><span class="annottext">nonBidirectionalErr :: forall name a. Outputable name =&gt; name -&gt; TcM a
</span><a href="GHC.Tc.TyCl.PatSyn.html#nonBidirectionalErr"><span class="hs-identifier hs-var hs-var">nonBidirectionalErr</span></a></span></span><span> </span><span id="local-6989586621681095246"><span class="annot"><span class="annottext">name
</span><a href="#local-6989586621681095246"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM a
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcM a) -&gt; MsgDoc -&gt; TcM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1098"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;non-bidirectional pattern synonym&quot;</span></span><span>
</span><span id="line-1099"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">name
</span><a href="#local-6989586621681095246"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;used in an expression&quot;</span></span><span>
</span><span id="line-1100"></span><span>
</span><span id="line-1101"></span><span class="hs-comment">-- Walk the whole pattern and for all ConPatOuts, collect the</span><span>
</span><span id="line-1102"></span><span class="hs-comment">-- existentially-bound type variables and evidence binding variables.</span><span>
</span><span id="line-1103"></span><span class="hs-comment">--</span><span>
</span><span id="line-1104"></span><span class="hs-comment">-- These are used in computing the type of a pattern synonym and also</span><span>
</span><span id="line-1105"></span><span class="hs-comment">-- in generating matcher functions, since success continuations need</span><span>
</span><span id="line-1106"></span><span class="hs-comment">-- to be passed these pattern-bound evidences.</span><span>
</span><span id="line-1107"></span><span class="annot"><a href="GHC.Tc.TyCl.PatSyn.html#tcCollectEx"><span class="hs-identifier hs-type">tcCollectEx</span></a></span><span>
</span><span id="line-1108"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-1109"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- Existentially-bound type variables</span><span>
</span><span id="line-1110"></span><span>                      </span><span class="hs-comment">-- in correctly-scoped order; e.g. [ k:*, x:k ]</span><span>
</span><span id="line-1111"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- and evidence variables</span><span>
</span><span id="line-1112"></span><span>
</span><span id="line-1113"></span><span id="tcCollectEx"><span class="annot"><span class="annottext">tcCollectEx :: LPat GhcTc -&gt; ([Id], [Id])
</span><a href="GHC.Tc.TyCl.PatSyn.html#tcCollectEx"><span class="hs-identifier hs-var hs-var">tcCollectEx</span></a></span></span><span> </span><span id="local-6989586621681095244"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095244"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095244"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-1114"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1115"></span><span>    </span><span class="annot"><a href="#local-6989586621681095243"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1116"></span><span>    </span><span id="local-6989586621681095243"><span class="annot"><span class="annottext">go :: LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="annot"><span class="annottext">(Pat GhcTc -&gt; ([Id], [Id]))
-&gt; (Located (Pat GhcTc) -&gt; Pat GhcTc)
-&gt; Located (Pat GhcTc)
-&gt; ([Id], [Id])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; Pat GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span>
</span><span id="line-1117"></span><span>
</span><span id="line-1118"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-type">go1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1119"></span><span>    </span><span id="local-6989586621681095242"><span class="annot"><span class="annottext">go1 :: Pat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095242"><span class="hs-identifier hs-var hs-var">go1</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LazyPat"><span class="hs-identifier hs-type">LazyPat</span></a></span><span> </span><span class="annot"><span class="annottext">XLazyPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095241"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095241"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095241"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1120"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#AsPat"><span class="hs-identifier hs-type">AsPat</span></a></span><span> </span><span class="annot"><span class="annottext">XAsPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcTc)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095240"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095240"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095240"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1121"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-type">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095239"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095239"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095239"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1122"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="annot"><span class="annottext">XBangPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095238"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095238"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095238"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1123"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ListPat"><span class="hs-identifier hs-type">ListPat</span></a></span><span> </span><span class="annot"><span class="annottext">XListPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095237"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681095237"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([Id], [Id])] -&gt; ([Id], [Id])
forall {a} {a}. [([a], [a])] -&gt; ([a], [a])
</span><a href="#local-6989586621681095236"><span class="hs-identifier hs-var">mergeMany</span></a></span><span> </span><span class="annot"><span class="annottext">([([Id], [Id])] -&gt; ([Id], [Id]))
-&gt; ([Located (Pat GhcTc)] -&gt; [([Id], [Id])])
-&gt; [Located (Pat GhcTc)]
-&gt; ([Id], [Id])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc) -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; [([Id], [Id])]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; ([Id], [Id])
LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">([Located (Pat GhcTc)] -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681095237"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-1124"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#TuplePat"><span class="hs-identifier hs-type">TuplePat</span></a></span><span> </span><span class="annot"><span class="annottext">XTuplePat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095235"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681095235"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="annot"><span class="annottext">Boxity
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([Id], [Id])] -&gt; ([Id], [Id])
forall {a} {a}. [([a], [a])] -&gt; ([a], [a])
</span><a href="#local-6989586621681095236"><span class="hs-identifier hs-var">mergeMany</span></a></span><span> </span><span class="annot"><span class="annottext">([([Id], [Id])] -&gt; ([Id], [Id]))
-&gt; ([Located (Pat GhcTc)] -&gt; [([Id], [Id])])
-&gt; [Located (Pat GhcTc)]
-&gt; ([Id], [Id])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc) -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; [([Id], [Id])]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; ([Id], [Id])
LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">([Located (Pat GhcTc)] -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681095235"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-1125"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SumPat"><span class="hs-identifier hs-type">SumPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSumPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095234"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095234"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095234"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1126"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#ViewPat"><span class="hs-identifier hs-type">ViewPat</span></a></span><span> </span><span class="annot"><span class="annottext">XViewPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095233"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095233"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095233"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1127"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span id="local-6989586621681095232"><span class="annot"><span class="annottext">con :: Pat GhcTc
</span><a href="#local-6989586621681095232"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Hs.Pat.html#ConPat"><span class="hs-identifier hs-type">ConPat</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_con_ext :: forall p. Pat p -&gt; XConPat p
</span><a href="GHC.Hs.Pat.html#pat_con_ext"><span class="hs-identifier hs-var">pat_con_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095230"><span class="annot"><span class="annottext">XConPat GhcTc
</span><a href="#local-6989586621681095230"><span class="hs-identifier hs-var">con'</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1128"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id], [Id]) -&gt; ([Id], [Id]) -&gt; ([Id], [Id])
forall {a} {a}. ([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a])
</span><a href="#local-6989586621681095229"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConPatTc -&gt; [Id]
</span><a href="GHC.Hs.Pat.html#cpt_tvs"><span class="hs-identifier hs-var hs-var">cpt_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">XConPat GhcTc
ConPatTc
</span><a href="#local-6989586621681095230"><span class="hs-identifier hs-var">con'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ConPatTc -&gt; [Id]
</span><a href="GHC.Hs.Pat.html#cpt_dicts"><span class="hs-identifier hs-var hs-var">cpt_dicts</span></a></span><span> </span><span class="annot"><span class="annottext">XConPat GhcTc
ConPatTc
</span><a href="#local-6989586621681095230"><span class="hs-identifier hs-var">con'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Id], [Id]) -&gt; ([Id], [Id])) -&gt; ([Id], [Id]) -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1129"></span><span>                              </span><span class="annot"><span class="annottext">HsConPatDetails GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095226"><span class="hs-identifier hs-var">goConDetails</span></a></span><span> </span><span class="annot"><span class="annottext">(HsConPatDetails GhcTc -&gt; ([Id], [Id]))
-&gt; HsConPatDetails GhcTc -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; HsConPatDetails GhcTc
forall p. Pat p -&gt; HsConPatDetails p
</span><a href="GHC.Hs.Pat.html#pat_args"><span class="hs-identifier hs-var hs-var">pat_args</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681095232"><span class="hs-identifier hs-var">con</span></a></span><span>
</span><span id="line-1130"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#SigPat"><span class="hs-identifier hs-type">SigPat</span></a></span><span> </span><span class="annot"><span class="annottext">XSigPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095224"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095224"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsPatSigType (NoGhcTc GhcTc)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095224"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1131"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#XPat"><span class="hs-identifier hs-type">XPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#CoPat"><span class="hs-identifier hs-type">CoPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095221"><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681095221"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Kind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><a href="#local-6989586621681095221"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1132"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#NPlusKPat"><span class="hs-identifier hs-type">NPlusKPat</span></a></span><span> </span><span class="annot"><span class="annottext">XNPlusKPat GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095220"><span class="annot"><span class="annottext">Located (IdP GhcTc)
</span><a href="#local-6989586621681095220"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681095219"><span class="annot"><span class="annottext">Located (HsOverLit GhcTc)
</span><a href="#local-6989586621681095219"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsOverLit GhcTc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681095218"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681095218"><span class="hs-identifier hs-var">geq</span></a></span></span><span> </span><span id="local-6989586621681095217"><span class="annot"><span class="annottext">SyntaxExpr GhcTc
</span><a href="#local-6989586621681095217"><span class="hs-identifier hs-var">subtract</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1133"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; ([Id], [Id])
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;TODO: NPlusKPat&quot;</span></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; ([Id], [Id])) -&gt; MsgDoc -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Located Id -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located Id
Located (IdP GhcTc)
</span><a href="#local-6989586621681095220"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Located (HsOverLit GhcTc) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located (HsOverLit GhcTc)
</span><a href="#local-6989586621681095219"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681095218"><span class="hs-identifier hs-var">geq</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681095217"><span class="hs-identifier hs-var">subtract</span></a></span><span>
</span><span id="line-1134"></span><span>    </span><span class="annot"><a href="#local-6989586621681095242"><span class="hs-identifier hs-var">go1</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcTc
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Id], [Id])
forall {a} {a}. ([a], [a])
</span><a href="#local-6989586621681095216"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1135"></span><span>
</span><span id="line-1136"></span><span>    </span><span class="annot"><a href="#local-6989586621681095226"><span class="hs-identifier hs-type">goConDetails</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsConPatDetails"><span class="hs-identifier hs-type">HsConPatDetails</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1137"></span><span>    </span><span id="local-6989586621681095226"><span class="annot"><span class="annottext">goConDetails :: HsConPatDetails GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095226"><span class="hs-identifier hs-var hs-var">goConDetails</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span id="local-6989586621681095215"><span class="annot"><span class="annottext">[LPat GhcTc]
</span><a href="#local-6989586621681095215"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([Id], [Id])] -&gt; ([Id], [Id])
forall {a} {a}. [([a], [a])] -&gt; ([a], [a])
</span><a href="#local-6989586621681095236"><span class="hs-identifier hs-var">mergeMany</span></a></span><span> </span><span class="annot"><span class="annottext">([([Id], [Id])] -&gt; ([Id], [Id]))
-&gt; ([Located (Pat GhcTc)] -&gt; [([Id], [Id])])
-&gt; [Located (Pat GhcTc)]
-&gt; ([Id], [Id])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc) -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; [([Id], [Id])]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; ([Id], [Id])
LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">([Located (Pat GhcTc)] -&gt; ([Id], [Id]))
-&gt; [Located (Pat GhcTc)] -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681095215"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-1138"></span><span>    </span><span class="annot"><a href="#local-6989586621681095226"><span class="hs-identifier hs-var">goConDetails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-type">InfixCon</span></a></span><span> </span><span id="local-6989586621681095214"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095214"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621681095213"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095213"><span class="hs-identifier hs-var">p2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095214"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">([Id], [Id]) -&gt; ([Id], [Id]) -&gt; ([Id], [Id])
forall {a} {a}. ([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a])
</span><a href="#local-6989586621681095229"><span class="hs-operator hs-var">`merge`</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095213"><span class="hs-identifier hs-var">p2</span></a></span><span>
</span><span id="line-1139"></span><span>    </span><span class="annot"><a href="#local-6989586621681095226"><span class="hs-identifier hs-var">goConDetails</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecFields"><span class="hs-identifier hs-type">HsRecFields</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">rec_flds :: forall p arg. HsRecFields p arg -&gt; [LHsRecField p arg]
</span><a href="GHC.Hs.Pat.html#rec_flds"><span class="hs-identifier hs-var">rec_flds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095210"><span class="annot"><span class="annottext">[LHsRecField GhcTc (LPat GhcTc)]
</span><a href="#local-6989586621681095210"><span class="hs-identifier hs-var">flds</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1140"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[([Id], [Id])] -&gt; ([Id], [Id])
forall {a} {a}. [([a], [a])] -&gt; ([a], [a])
</span><a href="#local-6989586621681095236"><span class="hs-identifier hs-var">mergeMany</span></a></span><span> </span><span class="annot"><span class="annottext">([([Id], [Id])] -&gt; ([Id], [Id]))
-&gt; ([LHsRecField GhcTc (Located (Pat GhcTc))] -&gt; [([Id], [Id])])
-&gt; [LHsRecField GhcTc (Located (Pat GhcTc))]
-&gt; ([Id], [Id])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsRecField GhcTc (Located (Pat GhcTc)) -&gt; ([Id], [Id]))
-&gt; [LHsRecField GhcTc (Located (Pat GhcTc))] -&gt; [([Id], [Id])]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LHsRecField GhcTc (Located (Pat GhcTc)) -&gt; ([Id], [Id])
LHsRecField GhcTc (LPat GhcTc) -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095209"><span class="hs-identifier hs-var">goRecFd</span></a></span><span> </span><span class="annot"><span class="annottext">([LHsRecField GhcTc (Located (Pat GhcTc))] -&gt; ([Id], [Id]))
-&gt; [LHsRecField GhcTc (Located (Pat GhcTc))] -&gt; ([Id], [Id])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsRecField GhcTc (Located (Pat GhcTc))]
[LHsRecField GhcTc (LPat GhcTc)]
</span><a href="#local-6989586621681095210"><span class="hs-identifier hs-var">flds</span></a></span><span>
</span><span id="line-1141"></span><span>
</span><span id="line-1142"></span><span>    </span><span class="annot"><a href="#local-6989586621681095209"><span class="hs-identifier hs-type">goRecFd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LHsRecField"><span class="hs-identifier hs-type">LHsRecField</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1143"></span><span>    </span><span id="local-6989586621681095209"><span class="annot"><span class="annottext">goRecFd :: LHsRecField GhcTc (LPat GhcTc) -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095209"><span class="hs-identifier hs-var hs-var">goRecFd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#HsRecField"><span class="hs-identifier hs-type">HsRecField</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsRecFieldArg :: forall id arg. HsRecField' id arg -&gt; arg
</span><a href="GHC.Hs.Pat.html#hsRecFieldArg"><span class="hs-identifier hs-var">hsRecFieldArg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681095206"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095206"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; ([Id], [Id])
</span><a href="#local-6989586621681095243"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681095206"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1144"></span><span>
</span><span id="line-1145"></span><span>    </span><span id="local-6989586621681095229"><span class="annot"><span class="annottext">merge :: ([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a])
</span><a href="#local-6989586621681095229"><span class="hs-identifier hs-var hs-var">merge</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095205"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095205"><span class="hs-identifier hs-var">vs1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095204"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095204"><span class="hs-identifier hs-var">evs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681095203"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095203"><span class="hs-identifier hs-var">vs2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681095202"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095202"><span class="hs-identifier hs-var">evs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095205"><span class="hs-identifier hs-var">vs1</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095203"><span class="hs-identifier hs-var">vs2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095204"><span class="hs-identifier hs-var">evs1</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a] -&gt; [a]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621681095202"><span class="hs-identifier hs-var">evs2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1146"></span><span>    </span><span id="local-6989586621681095236"><span class="annot"><span class="annottext">mergeMany :: [([a], [a])] -&gt; ([a], [a])
</span><a href="#local-6989586621681095236"><span class="hs-identifier hs-var hs-var">mergeMany</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a]))
-&gt; ([a], [a]) -&gt; [([a], [a])] -&gt; ([a], [a])
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a])
forall {a} {a}. ([a], [a]) -&gt; ([a], [a]) -&gt; ([a], [a])
</span><a href="#local-6989586621681095229"><span class="hs-identifier hs-var">merge</span></a></span><span> </span><span class="annot"><span class="annottext">([a], [a])
forall {a} {a}. ([a], [a])
</span><a href="#local-6989586621681095216"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-1147"></span><span>    </span><span id="local-6989586621681095216"><span class="annot"><span class="annottext">empty :: ([a], [a])
</span><a href="#local-6989586621681095216"><span class="hs-identifier hs-var hs-var">empty</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1148"></span></pre></body></html>